From 3f47d55e1eedb4b0b7848f435925163303696d86 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Thu, 1 Feb 2024 15:48:33 +0800 Subject: [PATCH 01/39] fix use of btree cursor api Signed-off-by: Richard Chien --- .../src/estimate_size/collections/btreemap.rs | 6 +- src/utils/delta_btree_map/src/lib.rs | 74 ++++++------------- 2 files changed, 27 insertions(+), 53 deletions(-) diff --git a/src/common/src/estimate_size/collections/btreemap.rs b/src/common/src/estimate_size/collections/btreemap.rs index 8510c578d31cf..3430571295e01 100644 --- a/src/common/src/estimate_size/collections/btreemap.rs +++ b/src/common/src/estimate_size/collections/btreemap.rs @@ -92,7 +92,11 @@ where // [ left, [mid], right ] let mut mid_right = self.inner.split_off(start); - let mid_right_split_key = mid_right.lower_bound(Bound::Excluded(end)).key().cloned(); + let mid_right_split_key = mid_right + .lower_bound(Bound::Excluded(end)) + .peek_next() + .map(|(k, _)| k) + .cloned(); let right = if let Some(ref mid_right_split_key) = mid_right_split_key { mid_right.split_off(mid_right_split_key) } else { diff --git a/src/utils/delta_btree_map/src/lib.rs b/src/utils/delta_btree_map/src/lib.rs index c300955af567b..33eb0cf1c175b 100644 --- a/src/utils/delta_btree_map/src/lib.rs +++ b/src/utils/delta_btree_map/src/lib.rs @@ -76,16 +76,18 @@ impl<'a, K: Ord, V> DeltaBTreeMap<'a, K, V> { pub fn find(&self, key: &K) -> Option> { let ss_cursor = self.snapshot.lower_bound(Bound::Included(key)); let dt_cursor = self.delta.lower_bound(Bound::Included(key)); - let curr_key_value = if dt_cursor.key() == Some(key) { - match dt_cursor.key_value().unwrap() { + let ss_cursor_kv = ss_cursor.peek_next(); + let dt_cursor_kv = dt_cursor.peek_next(); + let curr_key_value = if dt_cursor_kv.map(|(k, _)| k) == Some(key) { + match dt_cursor_kv.unwrap() { (key, Change::Insert(value)) => (key, value), (_key, Change::Delete) => { // the key is deleted return None; } } - } else if ss_cursor.key() == Some(key) { - ss_cursor.key_value().unwrap() + } else if ss_cursor_kv.map(|(k, _)| k) == Some(key) { + ss_cursor_kv.unwrap() } else { // the key doesn't exist return None; @@ -102,16 +104,8 @@ impl<'a, K: Ord, V> DeltaBTreeMap<'a, K, V> { // the implementation is very similar to `CursorWithDelta::peek_next` let mut ss_cursor = self.snapshot.lower_bound(bound); let mut dt_cursor = self.delta.lower_bound(bound); - let next_ss_entry = || { - let tmp = ss_cursor.key_value(); - ss_cursor.move_next(); - tmp - }; - let next_dt_entry = || { - let tmp = dt_cursor.key_value(); - dt_cursor.move_next(); - tmp - }; + let next_ss_entry = || ss_cursor.next(); + let next_dt_entry = || dt_cursor.next(); let curr_key_value = CursorWithDelta::peek_impl(PeekDirection::Next, next_ss_entry, next_dt_entry); CursorWithDelta { @@ -126,16 +120,8 @@ impl<'a, K: Ord, V> DeltaBTreeMap<'a, K, V> { // the implementation is very similar to `CursorWithDelta::peek_prev` let mut ss_cursor = self.snapshot.upper_bound(bound); let mut dt_cursor = self.delta.upper_bound(bound); - let prev_ss_entry = || { - let tmp = ss_cursor.key_value(); - ss_cursor.move_prev(); - tmp - }; - let prev_dt_entry = || { - let tmp = dt_cursor.key_value(); - dt_cursor.move_prev(); - tmp - }; + let prev_ss_entry = || ss_cursor.prev(); + let prev_dt_entry = || dt_cursor.prev(); let curr_key_value = CursorWithDelta::peek_impl(PeekDirection::Prev, prev_ss_entry, prev_dt_entry); CursorWithDelta { @@ -244,22 +230,14 @@ impl<'a, K: Ord, V> CursorWithDelta<'a, K, V> { let mut ss_cursor = self.snapshot.lower_bound(Bound::Included(key)); let mut dt_cursor = self.delta.lower_bound(Bound::Included(key)); // either one of `ss_cursor.key()` and `dt_cursor.key()` == `Some(key)`, or both are - if ss_cursor.key() == Some(key) { - ss_cursor.move_next(); + if ss_cursor.peek_next().map(|(k, _)| k) == Some(key) { + ss_cursor.next(); } - if dt_cursor.key() == Some(key) { - dt_cursor.move_next(); + if dt_cursor.peek_next().map(|(k, _)| k) == Some(key) { + dt_cursor.next(); } - let next_ss_entry = || { - let tmp = ss_cursor.key_value(); - ss_cursor.move_next(); - tmp - }; - let next_dt_entry = || { - let tmp = dt_cursor.key_value(); - dt_cursor.move_next(); - tmp - }; + let next_ss_entry = || ss_cursor.next(); + let next_dt_entry = || dt_cursor.next(); Self::peek_impl(PeekDirection::Next, next_ss_entry, next_dt_entry) } else { // we are at the ghost position, now let's go back to the beginning @@ -275,22 +253,14 @@ impl<'a, K: Ord, V> CursorWithDelta<'a, K, V> { let mut ss_cursor = self.snapshot.upper_bound(Bound::Included(key)); let mut dt_cursor = self.delta.upper_bound(Bound::Included(key)); // either one of `ss_cursor.key()` and `dt_cursor.key()` == `Some(key)`, or both are - if ss_cursor.key() == Some(key) { - ss_cursor.move_prev(); + if ss_cursor.peek_prev().map(|(k, _)| k) == Some(key) { + ss_cursor.prev(); } - if dt_cursor.key() == Some(key) { - dt_cursor.move_prev(); + if dt_cursor.peek_prev().map(|(k, _)| k) == Some(key) { + dt_cursor.prev(); } - let next_ss_entry = || { - let tmp = ss_cursor.key_value(); - ss_cursor.move_prev(); - tmp - }; - let next_dt_entry = || { - let tmp = dt_cursor.key_value(); - dt_cursor.move_prev(); - tmp - }; + let next_ss_entry = || ss_cursor.prev(); + let next_dt_entry = || dt_cursor.prev(); Self::peek_impl(PeekDirection::Prev, next_ss_entry, next_dt_entry) } else { // we are at the ghost position, now let's go back to the end From 0ef75ea09c6d06ca11709da8d6b51162a7ccd33e Mon Sep 17 00:00:00 2001 From: xxchan Date: Sat, 3 Feb 2024 11:08:45 +0800 Subject: [PATCH 02/39] remove stablized features --- src/batch/src/lib.rs | 2 -- src/common/src/lib.rs | 3 --- src/expr/impl/src/lib.rs | 1 - src/frontend/src/lib.rs | 1 - src/storage/hummock_sdk/src/lib.rs | 1 - src/storage/hummock_test/src/bin/replay/main.rs | 1 - src/storage/hummock_test/src/lib.rs | 1 - src/storage/hummock_trace/src/lib.rs | 1 - src/storage/src/lib.rs | 1 - src/stream/spill_test/src/lib.rs | 1 - src/stream/src/lib.rs | 1 - src/tests/compaction_test/src/lib.rs | 1 - 12 files changed, 15 deletions(-) diff --git a/src/batch/src/lib.rs b/src/batch/src/lib.rs index d1d9ab8f302f1..f6274833cd135 100644 --- a/src/batch/src/lib.rs +++ b/src/batch/src/lib.rs @@ -25,13 +25,11 @@ #![feature(is_sorted)] #![recursion_limit = "256"] #![feature(let_chains)] -#![feature(bound_map)] #![feature(int_roundings)] #![feature(allocator_api)] #![feature(impl_trait_in_assoc_type)] #![feature(assert_matches)] #![feature(lazy_cell)] -#![feature(array_methods)] #![feature(error_generic_member_access)] pub mod error; diff --git a/src/common/src/lib.rs b/src/common/src/lib.rs index dc13a39eb6956..72c22cf720a96 100644 --- a/src/common/src/lib.rs +++ b/src/common/src/lib.rs @@ -34,15 +34,12 @@ #![feature(inline_const_pat)] #![allow(incomplete_features)] #![feature(iterator_try_collect)] -#![feature(round_ties_even)] #![feature(iter_order_by)] #![feature(exclusive_range_pattern)] #![feature(binary_heap_into_iter_sorted)] #![feature(impl_trait_in_assoc_type)] #![feature(map_entry_replace)] #![feature(negative_impls)] -#![feature(bound_map)] -#![feature(array_methods)] #![feature(btree_cursors)] #[cfg_attr(not(test), allow(unused_extern_crates))] diff --git a/src/expr/impl/src/lib.rs b/src/expr/impl/src/lib.rs index a47754cb4e821..5bc4a758b42a1 100644 --- a/src/expr/impl/src/lib.rs +++ b/src/expr/impl/src/lib.rs @@ -27,7 +27,6 @@ #![feature(iterator_try_collect)] #![feature(exclusive_range_pattern)] #![feature(lazy_cell)] -#![feature(round_ties_even)] #![feature(coroutines)] #![feature(test)] #![feature(iter_array_chunks)] diff --git a/src/frontend/src/lib.rs b/src/frontend/src/lib.rs index 171ad1918af8f..c50c577b30a4d 100644 --- a/src/frontend/src/lib.rs +++ b/src/frontend/src/lib.rs @@ -32,7 +32,6 @@ #![feature(impl_trait_in_assoc_type)] #![feature(result_flattening)] #![feature(error_generic_member_access)] -#![feature(round_ties_even)] #![feature(iterator_try_collect)] #![feature(used_with_arg)] #![recursion_limit = "256"] diff --git a/src/storage/hummock_sdk/src/lib.rs b/src/storage/hummock_sdk/src/lib.rs index 8df27676591dd..fec1df73c6585 100644 --- a/src/storage/hummock_sdk/src/lib.rs +++ b/src/storage/hummock_sdk/src/lib.rs @@ -17,7 +17,6 @@ #![feature(hash_extract_if)] #![feature(lint_reasons)] #![feature(map_many_mut)] -#![feature(bound_map)] #![feature(type_alias_impl_trait)] #![feature(impl_trait_in_assoc_type)] #![feature(is_sorted)] diff --git a/src/storage/hummock_test/src/bin/replay/main.rs b/src/storage/hummock_test/src/bin/replay/main.rs index a768b563a8d40..03b8902dfe5b9 100644 --- a/src/storage/hummock_test/src/bin/replay/main.rs +++ b/src/storage/hummock_test/src/bin/replay/main.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![feature(bound_map)] #![feature(coroutines)] #![feature(stmt_expr_attributes)] #![feature(proc_macro_hygiene)] diff --git a/src/storage/hummock_test/src/lib.rs b/src/storage/hummock_test/src/lib.rs index 890277678b756..60d4b02fa5270 100644 --- a/src/storage/hummock_test/src/lib.rs +++ b/src/storage/hummock_test/src/lib.rs @@ -14,7 +14,6 @@ #![feature(proc_macro_hygiene, stmt_expr_attributes)] #![feature(custom_test_frameworks)] #![test_runner(risingwave_test_runner::test_runner::run_failpont_tests)] -#![feature(bound_map)] #![feature(type_alias_impl_trait)] #![feature(associated_type_bounds)] diff --git a/src/storage/hummock_trace/src/lib.rs b/src/storage/hummock_trace/src/lib.rs index 0de5680908254..64417832206e0 100644 --- a/src/storage/hummock_trace/src/lib.rs +++ b/src/storage/hummock_trace/src/lib.rs @@ -14,7 +14,6 @@ #![feature(lazy_cell)] #![feature(cursor_remaining)] -#![feature(bound_map)] #![feature(trait_alias)] #![feature(coroutines)] diff --git a/src/storage/src/lib.rs b/src/storage/src/lib.rs index 505eec276fbf4..e5b6e18ca3d98 100644 --- a/src/storage/src/lib.rs +++ b/src/storage/src/lib.rs @@ -14,7 +14,6 @@ #![feature(allocator_api)] #![feature(bound_as_ref)] -#![feature(bound_map)] #![feature(custom_test_frameworks)] #![feature(extract_if)] #![feature(coroutines)] diff --git a/src/stream/spill_test/src/lib.rs b/src/stream/spill_test/src/lib.rs index 9c2d3d05bda70..277bb458a4fcc 100644 --- a/src/stream/spill_test/src/lib.rs +++ b/src/stream/spill_test/src/lib.rs @@ -13,7 +13,6 @@ // limitations under the License. #![feature(proc_macro_hygiene, stmt_expr_attributes)] #![feature(custom_test_frameworks)] -#![feature(bound_map)] #![feature(type_alias_impl_trait)] #![feature(associated_type_bounds)] diff --git a/src/stream/src/lib.rs b/src/stream/src/lib.rs index 7b036ed520a1d..5e40cfea3d3b1 100644 --- a/src/stream/src/lib.rs +++ b/src/stream/src/lib.rs @@ -32,7 +32,6 @@ #![feature(lazy_cell)] #![feature(error_generic_member_access)] #![feature(btree_extract_if)] -#![feature(bound_map)] #![feature(iter_order_by)] #![feature(exact_size_is_empty)] #![feature(impl_trait_in_assoc_type)] diff --git a/src/tests/compaction_test/src/lib.rs b/src/tests/compaction_test/src/lib.rs index 1e2207fc99a9b..3d8f13e337a2a 100644 --- a/src/tests/compaction_test/src/lib.rs +++ b/src/tests/compaction_test/src/lib.rs @@ -22,7 +22,6 @@ #![warn(clippy::map_flatten)] #![warn(clippy::await_holding_lock)] #![deny(rustdoc::broken_intra_doc_links)] -#![feature(bound_map)] #![feature(register_tool)] #![register_tool(rw)] #![allow(rw::format_error)] // test code From 02c9d5d9ce2bd41e78ee016ebc0df6c804420d2b Mon Sep 17 00:00:00 2001 From: xxchan Date: Sat, 3 Feb 2024 11:21:45 +0800 Subject: [PATCH 03/39] update is_sorted_by api --- .../src/compaction_group/hummock_version_ext.rs | 8 +------- src/storage/hummock_sdk/src/table_watermark.rs | 9 ++------- src/storage/src/hummock/store/version.rs | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs index 9e07598d07920..b034cd8f6da49 100644 --- a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs +++ b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs @@ -1224,13 +1224,7 @@ pub fn validate_version(version: &HummockVersion) -> Vec { let mut prev_table_info: Option<&SstableInfo> = None; for table_info in &level.table_infos { // Ensure table_ids are sorted and unique - if !table_info.table_ids.is_sorted_by(|a, b| { - if a < b { - Some(Ordering::Less) - } else { - Some(Ordering::Greater) - } - }) { + if !table_info.table_ids.is_sorted_by(|a, b| a < b) { res.push(format!( "{} SST {}: table_ids not sorted", level_identifier, table_info.object_id diff --git a/src/storage/hummock_sdk/src/table_watermark.rs b/src/storage/hummock_sdk/src/table_watermark.rs index ed496618f8a33..f55d5c87cc419 100644 --- a/src/storage/hummock_sdk/src/table_watermark.rs +++ b/src/storage/hummock_sdk/src/table_watermark.rs @@ -554,13 +554,8 @@ impl TableWatermarks { // epoch watermark are added from later epoch to earlier epoch. // reverse to ensure that earlier epochs are at the front result_epoch_watermark.reverse(); - assert!( - result_epoch_watermark.is_sorted_by(|(first_epoch, _), (second_epoch, _)| { - let ret = first_epoch.cmp(second_epoch); - assert_ne!(ret, Ordering::Equal); - Some(ret) - }) - ); + assert!(result_epoch_watermark + .is_sorted_by(|(first_epoch, _), (second_epoch, _)| { first_epoch < second_epoch })); *self = TableWatermarks { watermarks: result_epoch_watermark, direction: self.direction, diff --git a/src/storage/src/hummock/store/version.rs b/src/storage/src/hummock/store/version.rs index b0e1f5911fead..073f10136264c 100644 --- a/src/storage/src/hummock/store/version.rs +++ b/src/storage/src/hummock/store/version.rs @@ -86,7 +86,7 @@ impl StagingSstableInfo { imm_size: usize, ) -> Self { // the epochs are sorted from higher epoch to lower epoch - assert!(epochs.is_sorted_by(|epoch1, epoch2| epoch2.partial_cmp(epoch1))); + assert!(epochs.is_sorted_by(|epoch1, epoch2| epoch2 <= epoch1)); Self { sstable_infos, epochs, From bdca24201f391316a2dfecb89a5c21b1d99a6cdc Mon Sep 17 00:00:00 2001 From: xxchan Date: Sat, 3 Feb 2024 11:24:05 +0800 Subject: [PATCH 04/39] trigger ci on push --- .github/workflows/nightly-rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nightly-rust.yml b/.github/workflows/nightly-rust.yml index eab964fafa177..f7341323ba494 100644 --- a/.github/workflows/nightly-rust.yml +++ b/.github/workflows/nightly-rust.yml @@ -5,6 +5,9 @@ name: Build with Latest Nightly Rust on: schedule: - cron: "0 0 * * *" + push: + branches: + - xxchan/latest-nightly-rust workflow_dispatch: jobs: From 2a6cb2aa757103a3a51d6a5aa2a04f6096df6233 Mon Sep 17 00:00:00 2001 From: xxchan Date: Sat, 3 Feb 2024 12:52:03 +0800 Subject: [PATCH 05/39] fix split_array and btree_cursors --- src/storage/hummock_sdk/src/key.rs | 6 +++++- src/storage/hummock_sdk/src/lib.rs | 1 - src/storage/hummock_sdk/src/table_watermark.rs | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/storage/hummock_sdk/src/key.rs b/src/storage/hummock_sdk/src/key.rs index a12783a19b415..9c47a65871910 100644 --- a/src/storage/hummock_sdk/src/key.rs +++ b/src/storage/hummock_sdk/src/key.rs @@ -476,7 +476,11 @@ impl> TableKey { "too short table key: {:?}", self.0.as_ref() ); - let (vnode, inner_key) = self.0.as_ref().split_array_ref::<{ VirtualNode::SIZE }>(); + let (vnode, inner_key) = self + .0 + .as_ref() + .split_first_chunk::<{ VirtualNode::SIZE }>() + .unwrap(); (VirtualNode::from_be_bytes(*vnode), inner_key) } diff --git a/src/storage/hummock_sdk/src/lib.rs b/src/storage/hummock_sdk/src/lib.rs index fec1df73c6585..e55e4d4f30f88 100644 --- a/src/storage/hummock_sdk/src/lib.rs +++ b/src/storage/hummock_sdk/src/lib.rs @@ -22,7 +22,6 @@ #![feature(is_sorted)] #![feature(let_chains)] #![feature(btree_cursors)] -#![feature(split_array)] mod key_cmp; use std::cmp::Ordering; diff --git a/src/storage/hummock_sdk/src/table_watermark.rs b/src/storage/hummock_sdk/src/table_watermark.rs index f55d5c87cc419..799fe6e10ef40 100644 --- a/src/storage/hummock_sdk/src/table_watermark.rs +++ b/src/storage/hummock_sdk/src/table_watermark.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::cmp::Ordering; use std::collections::hash_map::Entry; use std::collections::{btree_map, BTreeMap, HashMap, HashSet}; use std::mem::size_of; @@ -93,7 +92,8 @@ impl TableWatermarksIndex { self.index.get(&vnode).and_then(|epoch_watermarks| { epoch_watermarks .upper_bound(Included(&epoch)) - .value() + .peek_next() + .map(|(_, v)| v) .cloned() }) } From 427d75e759c28bc6329ee9857939c8311ac404c3 Mon Sep 17 00:00:00 2001 From: xxchan Date: Sat, 3 Feb 2024 13:36:51 +0800 Subject: [PATCH 06/39] fix btree_cursor for over_window --- .../executor/over_window/over_partition.rs | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/stream/src/executor/over_window/over_partition.rs b/src/stream/src/executor/over_window/over_partition.rs index a759e9e7334e3..c43c18aa2983f 100644 --- a/src/stream/src/executor/over_window/over_partition.rs +++ b/src/stream/src/executor/over_window/over_partition.rs @@ -90,25 +90,25 @@ pub(super) fn shrink_partition_cache( let mut cursor = range_cache.inner().upper_bound(Bound::Excluded(&ck_start)); for _ in 0..MAGIC_JITTER_PREVENTION { - if cursor.key().is_none() { + if cursor.prev().is_none() { break; } - cursor.move_prev(); } let start = cursor - .key() + .peek_prev() + .map(|(k, _)| k) .unwrap_or_else(|| range_cache.first_key_value().unwrap().0) .clone(); - let mut cursor = range_cache.inner().lower_bound(Bound::Excluded(&ck_end)); + let mut cursor = range_cache.inner().lower_bound(Bound::Included(&ck_start)); for _ in 0..MAGIC_JITTER_PREVENTION { - if cursor.key().is_none() { + if cursor.next().is_none() { break; } - cursor.move_next(); } let end = cursor - .key() + .peek_next() + .map(|(k, _)| k) .unwrap_or_else(|| range_cache.last_key_value().unwrap().0) .clone(); @@ -127,27 +127,27 @@ pub(super) fn shrink_partition_cache( let mut cursor = range_cache.inner().upper_bound(Bound::Excluded(&ck_start)); // go back for at most `MAGIC_JITTER_PREVENTION` entries for _ in 0..MAGIC_JITTER_PREVENTION { - if cursor.key().is_none() { + if cursor.prev().is_none() { break; } - cursor.move_prev(); capacity_remain -= 1; } let start = cursor - .key() + .peek_prev() + .map(|(k, _)| k) .unwrap_or_else(|| range_cache.first_key_value().unwrap().0) .clone(); let mut cursor = range_cache.inner().lower_bound(Bound::Included(&ck_start)); // go forward for at most `capacity_remain` entries for _ in 0..capacity_remain { - if cursor.key().is_none() { + if cursor.next().is_none() { break; } - cursor.move_next(); } let end = cursor - .key() + .peek_next() + .map(|(k, _)| k) .unwrap_or_else(|| range_cache.last_key_value().unwrap().0) .clone(); @@ -167,27 +167,27 @@ pub(super) fn shrink_partition_cache( let mut cursor = range_cache.inner().lower_bound(Bound::Excluded(&ck_end)); // go forward for at most `MAGIC_JITTER_PREVENTION` entries for _ in 0..MAGIC_JITTER_PREVENTION { - if cursor.key().is_none() { + if cursor.next().is_none() { break; } - cursor.move_next(); capacity_remain -= 1; } let end = cursor - .key() + .peek_next() + .map(|(k, _)| k) .unwrap_or_else(|| range_cache.last_key_value().unwrap().0) .clone(); let mut cursor = range_cache.inner().upper_bound(Bound::Included(&ck_end)); // go back for at most `capacity_remain` entries for _ in 0..capacity_remain { - if cursor.key().is_none() { + if cursor.prev().is_none() { break; } - cursor.move_prev(); } let start = cursor - .key() + .peek_prev() + .map(|(k, _)| k) .unwrap_or_else(|| range_cache.first_key_value().unwrap().0) .clone(); From 0d4316a38d43c9552fe16c72f7a9b785bd2611ff Mon Sep 17 00:00:00 2001 From: xxchan Date: Fri, 23 Feb 2024 09:48:58 +0800 Subject: [PATCH 07/39] bump hashbrown, ahash, crc32c, curve25519-dalek to fix SIMD --- Cargo.lock | 68 ++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8d705132c8f0..2787f1566e353 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,9 +36,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "const-random", @@ -260,7 +260,7 @@ version = "48.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8919668503a4f2d8b6da96fa7c16e93046bfb3412ffcfa1e5dc7d2e3adcb378" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow-arith 48.0.1", "arrow-array 48.0.1", "arrow-buffer 48.0.1", @@ -312,7 +312,7 @@ version = "48.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6eaf89041fa5937940ae390294ece29e1db584f46d995608d6e5fe65a2e0e9b" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow-buffer 48.0.1", "arrow-data 48.0.1", "arrow-schema 48.0.1", @@ -329,7 +329,7 @@ version = "50.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d390feeb7f21b78ec997a4081a025baef1e2e0d6069e181939b61864c9779609" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow-buffer 50.0.0", "arrow-data 50.0.0", "arrow-schema 50.0.0", @@ -544,7 +544,7 @@ version = "48.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5d664318bc05f930559fc088888f0f7174d3c5bc888c0f4f9ae8f23aa398ba3" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow-array 48.0.1", "arrow-buffer 48.0.1", "arrow-data 48.0.1", @@ -559,7 +559,7 @@ version = "50.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "007035e17ae09c4e8993e4cb8b5b96edf0afb927cd38e2dff27189b274d83dcf" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow-array 50.0.0", "arrow-buffer 50.0.0", "arrow-data 50.0.0", @@ -589,7 +589,7 @@ version = "48.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "374c4c3b812ecc2118727b892252a4a4308f87a8aca1dbf09f3ce4bc578e668a" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow-array 48.0.1", "arrow-buffer 48.0.1", "arrow-data 48.0.1", @@ -603,7 +603,7 @@ version = "50.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ce20973c1912de6514348e064829e50947e35977bb9d7fb637dc99ea9ffd78c" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow-array 50.0.0", "arrow-buffer 50.0.0", "arrow-data 50.0.0", @@ -2281,23 +2281,21 @@ checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "const-random" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" dependencies = [ "const-random-macro", - "proc-macro-hack", ] [[package]] name = "const-random-macro" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ "getrandom", "once_cell", - "proc-macro-hack", "tiny-keccak", ] @@ -2500,9 +2498,9 @@ checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" [[package]] name = "crc32c" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f48d60e5b4d2c53d5c2b1d8a58c849a70ae5e5509b08a48d047e3b65714a74" +checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" dependencies = [ "rustc_version", ] @@ -2735,9 +2733,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.0" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if", "cpufeatures", @@ -2962,7 +2960,7 @@ version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "676796427e638d85e9eadf13765705212be60b34f8fc5d3934d95184c63ca1b4" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow", "arrow-array 48.0.1", "arrow-schema 48.0.1", @@ -3009,7 +3007,7 @@ version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e23b3d21a6531259d291bd20ce59282ea794bda1018b0a1e278c13cd52e50c" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow", "arrow-array 48.0.1", "arrow-buffer 48.0.1", @@ -3049,7 +3047,7 @@ version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18e227fe88bf6730cab378d0cd8fc4c6b2ea42bc7e414a8ea9feba7225932735" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow", "arrow-array 48.0.1", "datafusion-common", @@ -3082,7 +3080,7 @@ version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f32b8574add16a32411a9b3fb3844ac1fc09ab4e7be289f86fd56d620e4f2508" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow", "arrow-array 48.0.1", "arrow-buffer 48.0.1", @@ -3117,7 +3115,7 @@ version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "796abd77d5bfecd9e5275a99daf0ec45f5b3a793ec431349ce8211a67826fd22" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow", "arrow-array 48.0.1", "arrow-buffer 48.0.1", @@ -4154,7 +4152,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a694cde4dd2c9fdd8cc2d294fcb265fdd6be1ee62fa35c37e9fc328871f33b6d" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "bitflags 2.4.2", "cmsketch 0.2.0", "crossbeam", @@ -4204,7 +4202,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a5ee5ab890d1893232fd44af33197c7499813816b8880649a15ee9438d5e07" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "cc", "crossbeam-channel", "crossbeam-utils", @@ -4835,7 +4833,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", ] [[package]] @@ -4844,7 +4842,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "allocator-api2", ] @@ -5230,7 +5228,7 @@ version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73c0fefcb6d409a6587c07515951495d482006f89a21daa0f2f783aa4fd5e027" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "indexmap 2.0.0", "is-terminal", "itoa", @@ -7161,7 +7159,7 @@ version = "48.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bfe55df96e3f02f11bf197ae37d91bb79801631f82f6195dd196ef521df3597" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow-array 48.0.1", "arrow-buffer 48.0.1", "arrow-cast 48.0.1", @@ -7195,7 +7193,7 @@ version = "50.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "547b92ebf0c1177e3892f44c8f79757ee62e678d564a9834189725f2c5b7a750" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "arrow-array 50.0.0", "arrow-buffer 50.0.0", "arrow-cast 50.0.0", @@ -10148,7 +10146,7 @@ dependencies = [ name = "risingwave_storage" version = "1.7.0-alpha" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "anyhow", "arc-swap", "async-trait", @@ -10737,7 +10735,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "cfg-if", "hashbrown 0.13.2", ] @@ -11671,7 +11669,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd4cef4251aabbae751a3710927945901ee1d97ee96d757f6880ebb9a79bfd53" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "atoi", "bigdecimal 0.3.1", "byteorder", @@ -14089,7 +14087,7 @@ dependencies = [ name = "workspace-hack" version = "1.7.0-alpha" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "aho-corasick", "allocator-api2", "anyhow", From e5a4a97094d7d16f7af4869f01892dcaf85eb789 Mon Sep 17 00:00:00 2001 From: xxchan Date: Sun, 17 Mar 2024 11:42:19 +0800 Subject: [PATCH 08/39] fix "non-defining opaque type use in defining scope" in metrics --- src/common/metrics/src/guarded_metrics.rs | 54 ++++++++++++++--------- src/common/metrics/src/lib.rs | 1 - 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/common/metrics/src/guarded_metrics.rs b/src/common/metrics/src/guarded_metrics.rs index 9c0919d7a420b..888dc76f73944 100644 --- a/src/common/metrics/src/guarded_metrics.rs +++ b/src/common/metrics/src/guarded_metrics.rs @@ -21,31 +21,15 @@ use std::sync::Arc; use itertools::Itertools; use parking_lot::Mutex; use prometheus::core::{ - Atomic, AtomicF64, AtomicI64, AtomicU64, Collector, Desc, GenericCounter, GenericCounterVec, - GenericGauge, GenericGaugeVec, GenericLocalCounter, MetricVec, MetricVecBuilder, + Atomic, AtomicF64, AtomicI64, AtomicU64, Collector, Desc, GenericCounter, GenericLocalCounter, + MetricVec, MetricVecBuilder, }; use prometheus::local::{LocalHistogram, LocalIntCounter}; use prometheus::proto::MetricFamily; -use prometheus::{Gauge, Histogram, HistogramVec, IntCounter, IntGauge}; +use prometheus::{Gauge, Histogram, IntCounter, IntGauge}; use thiserror_ext::AsReport; use tracing::warn; -pub fn __extract_counter_builder( - vec: GenericCounterVec

, -) -> MetricVec> { - vec -} - -pub fn __extract_gauge_builder( - vec: GenericGaugeVec

, -) -> MetricVec> { - vec -} - -pub fn __extract_histogram_builder(vec: HistogramVec) -> MetricVec { - vec -} - #[macro_export] macro_rules! register_guarded_histogram_vec_with_registry { ($NAME:expr, $HELP:expr, $LABELS_NAMES:expr, $REGISTRY:expr $(,)?) => {{ @@ -105,9 +89,35 @@ macro_rules! register_guarded_int_counter_vec_with_registry { }}; } -pub type VecBuilderOfCounter = impl MetricVecBuilder>; -pub type VecBuilderOfGauge = impl MetricVecBuilder>; -pub type VecBuilderOfHistogram = impl MetricVecBuilder; +// put TAITs in a separate module to avoid "non-defining opaque type use in defining scope" +mod tait { + use prometheus::core::{ + Atomic, GenericCounter, GenericCounterVec, GenericGauge, GenericGaugeVec, MetricVec, + MetricVecBuilder, + }; + use prometheus::{Histogram, HistogramVec}; + + pub type VecBuilderOfCounter = impl MetricVecBuilder>; + pub type VecBuilderOfGauge = impl MetricVecBuilder>; + pub type VecBuilderOfHistogram = impl MetricVecBuilder; + + pub fn __extract_counter_builder( + vec: GenericCounterVec

, + ) -> MetricVec> { + vec + } + + pub fn __extract_gauge_builder( + vec: GenericGaugeVec

, + ) -> MetricVec> { + vec + } + + pub fn __extract_histogram_builder(vec: HistogramVec) -> MetricVec { + vec + } +} +pub use tait::*; pub type LabelGuardedHistogramVec = LabelGuardedMetricVec; pub type LabelGuardedIntCounterVec = diff --git a/src/common/metrics/src/lib.rs b/src/common/metrics/src/lib.rs index a2e4156b525d1..574e684c6703b 100644 --- a/src/common/metrics/src/lib.rs +++ b/src/common/metrics/src/lib.rs @@ -15,7 +15,6 @@ #![feature(lazy_cell)] #![feature(type_alias_impl_trait)] #![feature(impl_trait_in_assoc_type)] -#![feature(array_methods)] use std::ops::Deref; use std::sync::LazyLock; From 601e35eca3f3c8d8438fb190ddf5db68ccb223fd Mon Sep 17 00:00:00 2001 From: xxchan Date: Sun, 17 Mar 2024 12:44:10 +0800 Subject: [PATCH 09/39] bump --- ci/build-ci-image.sh | 2 +- ci/docker-compose.yml | 10 +++++----- ci/rust-toolchain | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/build-ci-image.sh b/ci/build-ci-image.sh index 46a236a058bc5..adc79e0ed0e6f 100755 --- a/ci/build-ci-image.sh +++ b/ci/build-ci-image.sh @@ -10,7 +10,7 @@ cat ../rust-toolchain # shellcheck disable=SC2155 # REMEMBER TO ALSO UPDATE ci/docker-compose.yml -export BUILD_ENV_VERSION=v20240229 +export BUILD_ENV_VERSION=v20240317 export BUILD_TAG="public.ecr.aws/x5u3w5h6/rw-build-env:${BUILD_ENV_VERSION}" diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index 78a6a3085cb5f..0e7da86b9febb 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -71,7 +71,7 @@ services: retries: 5 source-test-env: - image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240229 + image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240317 depends_on: - mysql - db @@ -81,7 +81,7 @@ services: - ..:/risingwave sink-test-env: - image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240229 + image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240317 depends_on: - mysql - db @@ -98,12 +98,12 @@ services: rw-build-env: - image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240229 + image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240317 volumes: - ..:/risingwave ci-flamegraph-env: - image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240229 + image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240317 # NOTE(kwannoel): This is used in order to permit # syscalls for `nperf` (perf_event_open), # so it can do CPU profiling. @@ -114,7 +114,7 @@ services: - ..:/risingwave regress-test-env: - image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240229 + image: public.ecr.aws/x5u3w5h6/rw-build-env:v20240317 depends_on: db: condition: service_healthy diff --git a/ci/rust-toolchain b/ci/rust-toolchain index b1f2df70a8d0f..880273bbba3af 100644 --- a/ci/rust-toolchain +++ b/ci/rust-toolchain @@ -4,4 +4,4 @@ # 3. (optional) **follow the instructions in lints/README.md** to update the toolchain and dependencies for lints [toolchain] -channel = "nightly-2023-12-26" +channel = "nightly-2024-03-17" From 6c1cfc51cc9e3a90e6e2cccc8f5fec04e16f6dbc Mon Sep 17 00:00:00 2001 From: xxchan Date: Mon, 18 Mar 2024 23:24:19 +0800 Subject: [PATCH 10/39] fix storage compile error according to the compiler's suggestion (I HAVE NO IDEA WHAT I DID) --- src/storage/src/store.rs | 6 ++++-- src/stream/src/common/log_store_impl/kv_log_store/serde.rs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/storage/src/store.rs b/src/storage/src/store.rs index 2a70002c42af8..7659db79962e8 100644 --- a/src/storage/src/store.rs +++ b/src/storage/src/store.rs @@ -65,7 +65,8 @@ pub fn to_owned_item((key, value): StateStoreIterItemRef<'_>) -> StorageResult: StateStoreIter + Sized { - type ItemStream: Stream> + Send; + type ItemStream Fn(T::ItemRef<'a>) -> StorageResult>: Stream> + + Send; fn into_stream Fn(T::ItemRef<'a>) -> StorageResult + Send>( self, @@ -150,7 +151,8 @@ impl> FusedStateStoreIter { } impl> StateStoreIterExt for I { - type ItemStream = impl Stream> + Send; + type ItemStream Fn(T::ItemRef<'a>) -> StorageResult> = + impl Stream> + Send; fn into_stream Fn(T::ItemRef<'a>) -> StorageResult + Send>( self, diff --git a/src/stream/src/common/log_store_impl/kv_log_store/serde.rs b/src/stream/src/common/log_store_impl/kv_log_store/serde.rs index 67167f466a50b..10f7a0eb99c88 100644 --- a/src/stream/src/common/log_store_impl/kv_log_store/serde.rs +++ b/src/stream/src/common/log_store_impl/kv_log_store/serde.rs @@ -43,6 +43,7 @@ use risingwave_storage::row_serde::row_serde_util::{serialize_pk, serialize_pk_w use risingwave_storage::row_serde::value_serde::ValueRowSerdeNew; use risingwave_storage::store::{StateStoreIterExt, StateStoreReadIter}; use risingwave_storage::table::{compute_vnode, TableDistribution, SINGLETON_VNODE}; +use risingwave_storage::StateStoreIter; use rw_futures_util::select_all; use crate::common::log_store_impl::kv_log_store::{ @@ -544,7 +545,7 @@ impl LogStoreRowOpStream { } } -pub(crate) type LogStoreItemMergeStream = +pub(crate) type LogStoreItemMergeStream = impl Stream>; pub(crate) fn merge_log_store_item_stream( iters: Vec, From d55b9f7d91b6ca7ba0daccf21fd334da7372d5b4 Mon Sep 17 00:00:00 2001 From: MrCroxx Date: Thu, 11 Apr 2024 16:28:25 +0800 Subject: [PATCH 11/39] fix: upgrade jsonbb to fix panic Signed-off-by: MrCroxx --- Cargo.lock | 6 +++--- Cargo.toml | 1 + src/common/Cargo.toml | 2 +- src/common/estimate_size/Cargo.toml | 2 +- src/common/heap_profiling/src/jeprof.rs | 1 - src/common/src/array/data_chunk.rs | 2 +- src/common/src/lib.rs | 2 -- src/common/src/system_param/mod.rs | 4 ++-- src/config/docs.md | 4 ++-- src/expr/impl/Cargo.toml | 2 +- src/frontend/Cargo.toml | 2 +- src/utils/pgwire/src/pg_server.rs | 1 - 12 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4fe1ae1b613b4..57f44546974fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1776,7 +1776,7 @@ dependencies = [ "bitflags 2.5.0", "cexpr", "clang-sys", - "itertools 0.10.5", + "itertools 0.12.1", "lazy_static", "lazycell", "log", @@ -6457,9 +6457,9 @@ dependencies = [ [[package]] name = "jsonbb" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2edfc17ad42a5ece82df036301d5ef0c3dc3d071e28aa8a62e461711c55d19" +checksum = "91cdcbd02ee94c68803dd808bf8406e91491eaf875f09da650f5893dc56be18c" dependencies = [ "bytes", "serde", diff --git a/Cargo.toml b/Cargo.toml index d967ccb82268b..a384b6c335f33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -155,6 +155,7 @@ deltalake = { git = "https://github.com/risingwavelabs/delta-rs", rev = "5c2dccd "gcs", ] } itertools = "0.12.0" +jsonbb = "0.1.4" lru = { git = "https://github.com/risingwavelabs/lru-rs.git", rev = "2682b85" } parquet = "50" thiserror-ext = "0.0.11" diff --git a/src/common/Cargo.toml b/src/common/Cargo.toml index 3108e06e789f2..fcd92cfbbef84 100644 --- a/src/common/Cargo.toml +++ b/src/common/Cargo.toml @@ -54,7 +54,7 @@ humantime = "2.1" hytra = { workspace = true } itertools = { workspace = true } itoa = "1.0" -jsonbb = "0.1.2" +jsonbb = { workspace = true } lru = { workspace = true } memcomparable = { version = "0.2", features = ["decimal"] } num-integer = "0.1" diff --git a/src/common/estimate_size/Cargo.toml b/src/common/estimate_size/Cargo.toml index 04bcf369cc588..24cf19b3809e9 100644 --- a/src/common/estimate_size/Cargo.toml +++ b/src/common/estimate_size/Cargo.toml @@ -19,7 +19,7 @@ bytes = "1" educe = "0.5" ethnum = { version = "1", features = ["serde"] } fixedbitset = "0.5" -jsonbb = "0.1.2" +jsonbb = { workspace = true } lru = { workspace = true } risingwave_common_proc_macro = { workspace = true } rust_decimal = "1" diff --git a/src/common/heap_profiling/src/jeprof.rs b/src/common/heap_profiling/src/jeprof.rs index b0ae0f1658c9e..6c17fed7045a5 100644 --- a/src/common/heap_profiling/src/jeprof.rs +++ b/src/common/heap_profiling/src/jeprof.rs @@ -14,7 +14,6 @@ use std::path::Path; use std::process::Command; -use std::result::Result; use std::{env, fs}; /// Error type for running `jeprof`. diff --git a/src/common/src/array/data_chunk.rs b/src/common/src/array/data_chunk.rs index 849979abc5155..711573ae8d94b 100644 --- a/src/common/src/array/data_chunk.rs +++ b/src/common/src/array/data_chunk.rs @@ -13,10 +13,10 @@ // limitations under the License. use std::borrow::Cow; +use std::fmt; use std::fmt::Display; use std::hash::BuildHasher; use std::sync::Arc; -use std::{fmt, usize}; use bytes::Bytes; use either::Either; diff --git a/src/common/src/lib.rs b/src/common/src/lib.rs index 79b41aa8857d0..52bcca4860016 100644 --- a/src/common/src/lib.rs +++ b/src/common/src/lib.rs @@ -40,8 +40,6 @@ #![feature(impl_trait_in_assoc_type)] #![feature(map_entry_replace)] #![feature(negative_impls)] -#![feature(bound_map)] -#![feature(array_methods)] #![feature(register_tool)] #![feature(btree_cursors)] #![register_tool(rw)] diff --git a/src/common/src/system_param/mod.rs b/src/common/src/system_param/mod.rs index 06d4cce2e4e6b..f71324cb4e55d 100644 --- a/src/common/src/system_param/mod.rs +++ b/src/common/src/system_param/mod.rs @@ -77,10 +77,10 @@ macro_rules! for_all_params { { barrier_interval_ms, u32, Some(1000_u32), true, "The interval of periodic barrier.", }, { checkpoint_frequency, u64, Some(1_u64), true, "There will be a checkpoint for every n barriers.", }, { sstable_size_mb, u32, Some(256_u32), false, "Target size of the Sstable.", }, - { parallel_compact_size_mb, u32, Some(512_u32), false, "", }, + { parallel_compact_size_mb, u32, Some(512_u32), false, "The size of parallel task for one compact/flush job.", }, { block_size_kb, u32, Some(64_u32), false, "Size of each block in bytes in SST.", }, { bloom_false_positive, f64, Some(0.001_f64), false, "False positive probability of bloom filter.", }, - { state_store, String, None, false, "", }, + { state_store, String, None, false, "URL for the state store", }, { data_directory, String, None, false, "Remote directory for storing data and metadata objects.", }, { backup_storage_url, String, None, true, "Remote storage url for storing snapshots.", }, { backup_storage_directory, String, None, true, "Remote directory for storing snapshots.", }, diff --git a/src/config/docs.md b/src/config/docs.md index d925a428fb211..033adcd9ece98 100644 --- a/src/config/docs.md +++ b/src/config/docs.md @@ -155,7 +155,7 @@ This page is automatically generated by `./risedev generate-example-config` | data_directory | Remote directory for storing data and metadata objects. | | | enable_tracing | Whether to enable distributed tracing. | false | | max_concurrent_creating_streaming_jobs | Max number of concurrent creating streaming jobs. | 1 | -| parallel_compact_size_mb | | 512 | +| parallel_compact_size_mb | The size of parallel task for one compact/flush job. | 512 | | pause_on_next_bootstrap | Whether to pause all data sources on next bootstrap. | false | | sstable_size_mb | Target size of the Sstable. | 256 | -| state_store | | | +| state_store | URL for the state store | | diff --git a/src/expr/impl/Cargo.toml b/src/expr/impl/Cargo.toml index 082f33de2da4e..69bc8a0c73c4c 100644 --- a/src/expr/impl/Cargo.toml +++ b/src/expr/impl/Cargo.toml @@ -32,7 +32,7 @@ futures-util = "0.3" hex = "0.4" icelake = { workspace = true } itertools = { workspace = true } -jsonbb = "0.1.2" +jsonbb = { workspace = true } linkme = { version = "0.3", features = ["used_linker"] } md5 = "0.7" num-traits = "0.2" diff --git a/src/frontend/Cargo.toml b/src/frontend/Cargo.toml index 3cba7afe82660..8b748f1e83629 100644 --- a/src/frontend/Cargo.toml +++ b/src/frontend/Cargo.toml @@ -40,7 +40,7 @@ futures-async-stream = { workspace = true } iana-time-zone = "0.1" icelake = { workspace = true } itertools = { workspace = true } -jsonbb = "0.1.2" +jsonbb = { workspace = true } linkme = { version = "0.3", features = ["used_linker"] } maplit = "1" md5 = "0.7.0" diff --git a/src/utils/pgwire/src/pg_server.rs b/src/utils/pgwire/src/pg_server.rs index 7f6dd41368d45..da49972ef0bbb 100644 --- a/src/utils/pgwire/src/pg_server.rs +++ b/src/utils/pgwire/src/pg_server.rs @@ -15,7 +15,6 @@ use std::collections::HashMap; use std::future::Future; use std::io; -use std::result::Result; use std::str::FromStr; use std::sync::Arc; use std::time::Instant; From 2316d96789f5b5d64c7dd45d83f628c51436437b Mon Sep 17 00:00:00 2001 From: MrCroxx Date: Thu, 11 Apr 2024 18:46:40 +0800 Subject: [PATCH 12/39] chore: remove reduntant uses Signed-off-by: MrCroxx --- src/compute/src/rpc/service/config_service.rs | 1 - src/connector/src/parser/avro/parser.rs | 9 +++------ .../src/parser/canal/simd_json_parser.rs | 1 - src/connector/src/parser/debezium/avro_parser.rs | 5 +---- .../src/parser/debezium/simd_json_parser.rs | 2 -- src/connector/src/parser/protobuf/parser.rs | 2 +- src/connector/src/parser/unified/avro.rs | 2 +- src/connector/src/sink/encoder/json.rs | 4 ++-- src/connector/src/sink/redis.rs | 4 ++-- src/connector/src/sink/snowflake_connector.rs | 1 - src/connector/src/source/kafka/mod.rs | 2 -- .../src/source/kinesis/enumerator/client.rs | 2 +- src/connector/src/source/kinesis/mod.rs | 2 -- .../src/source/kinesis/source/reader.rs | 2 -- src/connector/src/source/nats/source/message.rs | 1 - .../src/source/nexmark/source/reader.rs | 2 +- src/ctl/src/cmd_impl/compute.rs | 2 -- src/ctl/src/cmd_impl/meta/reschedule.rs | 1 - src/ctl/src/cmd_impl/scale/resize.rs | 1 - src/dml/src/dml_manager.rs | 1 - src/dml/src/table.rs | 5 +---- src/error/src/macros.rs | 3 --- src/expr/core/src/expr/and_or.rs | 3 --- src/expr/core/src/expr/expr_literal.rs | 1 - src/expr/core/src/expr/expr_some_all.rs | 1 - src/expr/core/src/expr/expr_udf.rs | 1 - src/expr/core/src/table_function/user_defined.rs | 2 +- src/expr/impl/benches/expr.rs | 1 - src/expr/impl/src/aggregate/general.rs | 2 -- src/expr/impl/src/scalar/arithmetic_op.rs | 5 +---- src/expr/impl/src/scalar/bitwise_op.rs | 1 - src/expr/impl/src/scalar/case.rs | 1 - src/expr/impl/src/scalar/cast.rs | 2 -- src/expr/impl/src/scalar/proctime.rs | 1 - src/expr/impl/src/scalar/round.rs | 3 --- src/expr/impl/src/scalar/trigonometric.rs | 2 +- src/frontend/src/binder/expr/value.rs | 3 +-- src/frontend/src/binder/values.rs | 2 +- src/frontend/src/catalog/table_catalog.rs | 6 +----- src/frontend/src/handler/create_function.rs | 3 --- src/frontend/src/handler/create_sql_function.rs | 5 ----- src/frontend/src/handler/create_table.rs | 7 +------ src/frontend/src/handler/drop_function.rs | 3 --- src/frontend/src/handler/show.rs | 1 - src/frontend/src/handler/util.rs | 2 -- src/frontend/src/optimizer/mod.rs | 4 ---- src/frontend/src/optimizer/optimizer_context.rs | 1 - .../src/optimizer/plan_node/batch_delete.rs | 1 - .../src/optimizer/plan_node/batch_hash_agg.rs | 2 +- .../src/optimizer/plan_node/batch_hash_join.rs | 3 +-- .../src/optimizer/plan_node/batch_insert.rs | 1 - .../src/optimizer/plan_node/batch_limit.rs | 1 - .../src/optimizer/plan_node/batch_lookup_join.rs | 3 +-- .../src/optimizer/plan_node/batch_max_one_row.rs | 2 +- .../plan_node/batch_nested_loop_join.rs | 5 +++-- .../src/optimizer/plan_node/batch_over_window.rs | 1 - .../src/optimizer/plan_node/batch_simple_agg.rs | 2 +- .../src/optimizer/plan_node/batch_sort.rs | 1 - .../src/optimizer/plan_node/batch_sort_agg.rs | 2 +- .../src/optimizer/plan_node/batch_topn.rs | 1 - .../src/optimizer/plan_node/batch_update.rs | 1 - src/frontend/src/optimizer/plan_node/convert.rs | 3 +-- .../src/optimizer/plan_node/expr_rewritable.rs | 3 --- .../src/optimizer/plan_node/expr_visitable.rs | 3 --- .../src/optimizer/plan_node/logical_agg.rs | 5 +---- .../src/optimizer/plan_node/logical_filter.rs | 4 ++-- .../optimizer/plan_node/logical_hop_window.rs | 1 - .../src/optimizer/plan_node/logical_join.rs | 2 +- .../optimizer/plan_node/logical_multi_join.rs | 2 +- .../src/optimizer/plan_node/logical_project.rs | 2 +- .../optimizer/plan_node/logical_project_set.rs | 2 -- .../src/optimizer/plan_node/logical_union.rs | 3 +-- .../src/optimizer/plan_node/logical_values.rs | 4 +--- src/frontend/src/optimizer/plan_node/mod.rs | 2 +- .../src/optimizer/plan_node/plan_base.rs | 5 +---- .../optimizer/plan_node/predicate_pushdown.rs | 1 - .../src/optimizer/plan_node/stream_delta_join.rs | 3 +-- .../src/optimizer/plan_node/stream_dml.rs | 1 - .../optimizer/plan_node/stream_dynamic_filter.rs | 3 +-- .../plan_node/stream_eowc_over_window.rs | 2 +- .../src/optimizer/plan_node/stream_group_topn.rs | 3 +-- .../src/optimizer/plan_node/stream_hash_agg.rs | 3 +-- .../src/optimizer/plan_node/stream_hash_join.rs | 3 +-- .../src/optimizer/plan_node/stream_hop_window.rs | 2 -- .../optimizer/plan_node/stream_materialize.rs | 2 -- .../optimizer/plan_node/stream_over_window.rs | 1 - .../src/optimizer/plan_node/stream_project.rs | 2 -- .../src/optimizer/plan_node/stream_share.rs | 1 - .../src/optimizer/plan_node/stream_sink.rs | 3 +-- .../plan_node/stream_stateless_simple_agg.rs | 1 - .../optimizer/plan_node/stream_temporal_join.rs | 2 -- .../src/optimizer/plan_node/stream_union.rs | 2 -- .../plan_node/stream_watermark_filter.rs | 1 - .../plan_visitor/jsonb_stream_key_checker.rs | 2 +- .../src/optimizer/property/distribution.rs | 1 - src/frontend/src/optimizer/property/order.rs | 1 - .../pull_up_correlated_predicate_agg_rule.rs | 1 - .../rule/pull_up_correlated_predicate_rule.rs | 1 - src/frontend/src/scheduler/distributed/query.rs | 1 - src/frontend/src/telemetry.rs | 1 - src/frontend/src/utils/condition.rs | 2 -- src/frontend/src/utils/with_options.rs | 1 - src/jni_core/src/jvm_runtime.rs | 1 - src/meta/src/barrier/command.rs | 1 - src/meta/src/controller/fragment.rs | 1 - .../picker/base_level_compaction_picker.rs | 5 +---- .../picker/manual_compaction_picker.rs | 4 ++-- .../picker/min_overlap_compaction_picker.rs | 2 -- src/meta/src/manager/catalog/mod.rs | 1 - src/meta/src/storage/etcd_meta_store.rs | 1 - src/meta/src/stream/stream_manager.rs | 16 ++++++---------- src/object_store/src/object/error.rs | 1 - src/object_store/src/object/mem.rs | 1 - .../opendal_engine/opendal_object_store.rs | 2 -- src/sqlparser/tests/sqlparser_common.rs | 1 - src/storage/hummock_sdk/src/key.rs | 2 -- .../hummock_test/benches/bench_hummock_iter.rs | 1 - .../hummock_test/src/hummock_storage_tests.rs | 1 - src/storage/hummock_test/src/lib.rs | 1 - src/storage/hummock_trace/src/replay/worker.rs | 5 +---- 120 files changed, 58 insertions(+), 221 deletions(-) diff --git a/src/compute/src/rpc/service/config_service.rs b/src/compute/src/rpc/service/config_service.rs index 97793f71722c9..e827ef176413e 100644 --- a/src/compute/src/rpc/service/config_service.rs +++ b/src/compute/src/rpc/service/config_service.rs @@ -18,7 +18,6 @@ use risingwave_common::error::tonic::ToTonicStatus; use risingwave_pb::compute::config_service_server::ConfigService; use risingwave_pb::compute::{ShowConfigRequest, ShowConfigResponse}; use risingwave_stream::task::LocalStreamManager; -use serde_json; use tonic::{Code, Request, Response, Status}; pub struct ConfigServiceImpl { diff --git a/src/connector/src/parser/avro/parser.rs b/src/connector/src/parser/avro/parser.rs index 6125e87d069bf..904f1ccbece7b 100644 --- a/src/connector/src/parser/avro/parser.rs +++ b/src/connector/src/parser/avro/parser.rs @@ -182,8 +182,8 @@ mod test { use std::path::PathBuf; use apache_avro::schema::RecordSchema; - use apache_avro::types::{Record, Value}; - use apache_avro::{Codec, Days, Duration, Millis, Months, Reader, Schema, Writer}; + use apache_avro::types::Record; + use apache_avro::{Codec, Days, Duration, Millis, Months, Writer}; use itertools::Itertools; use risingwave_common::array::Op; use risingwave_common::catalog::ColumnId; @@ -195,12 +195,9 @@ mod test { use super::*; use crate::connector_common::AwsAuthProps; - use crate::error::ConnectorResult; use crate::parser::plain_parser::PlainParser; use crate::parser::unified::avro::unix_epoch_days; - use crate::parser::{ - AccessBuilderImpl, EncodingType, SourceStreamChunkBuilder, SpecificParserConfig, - }; + use crate::parser::{AccessBuilderImpl, SourceStreamChunkBuilder, SpecificParserConfig}; use crate::source::SourceColumnDesc; fn test_data_path(file_name: &str) -> String { diff --git a/src/connector/src/parser/canal/simd_json_parser.rs b/src/connector/src/parser/canal/simd_json_parser.rs index 75e6656fd7a7a..74d36a1ea7743 100644 --- a/src/connector/src/parser/canal/simd_json_parser.rs +++ b/src/connector/src/parser/canal/simd_json_parser.rs @@ -141,7 +141,6 @@ mod tests { use super::*; use crate::parser::SourceStreamChunkBuilder; - use crate::source::SourceColumnDesc; #[tokio::test] async fn test_data_types() { diff --git a/src/connector/src/parser/debezium/avro_parser.rs b/src/connector/src/parser/debezium/avro_parser.rs index ca1574af3d6b2..d445ec6779163 100644 --- a/src/connector/src/parser/debezium/avro_parser.rs +++ b/src/connector/src/parser/debezium/avro_parser.rs @@ -139,7 +139,6 @@ mod tests { use std::io::Read; use std::path::PathBuf; - use apache_avro::Schema; use itertools::Itertools; use maplit::{convert_args, hashmap}; use risingwave_common::array::Op; @@ -151,9 +150,7 @@ mod tests { use risingwave_pb::plan_common::{PbEncodeType, PbFormatType}; use super::*; - use crate::parser::{ - DebeziumAvroParserConfig, DebeziumParser, SourceStreamChunkBuilder, SpecificParserConfig, - }; + use crate::parser::{DebeziumParser, SourceStreamChunkBuilder, SpecificParserConfig}; use crate::source::SourceColumnDesc; const DEBEZIUM_AVRO_DATA: &[u8] = b"\x00\x00\x00\x00\x06\x00\x02\xd2\x0f\x0a\x53\x61\x6c\x6c\x79\x0c\x54\x68\x6f\x6d\x61\x73\x2a\x73\x61\x6c\x6c\x79\x2e\x74\x68\x6f\x6d\x61\x73\x40\x61\x63\x6d\x65\x2e\x63\x6f\x6d\x16\x32\x2e\x31\x2e\x32\x2e\x46\x69\x6e\x61\x6c\x0a\x6d\x79\x73\x71\x6c\x12\x64\x62\x73\x65\x72\x76\x65\x72\x31\xc0\xb4\xe8\xb7\xc9\x61\x00\x30\x66\x69\x72\x73\x74\x5f\x69\x6e\x5f\x64\x61\x74\x61\x5f\x63\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e\x12\x69\x6e\x76\x65\x6e\x74\x6f\x72\x79\x00\x02\x12\x63\x75\x73\x74\x6f\x6d\x65\x72\x73\x00\x00\x20\x6d\x79\x73\x71\x6c\x2d\x62\x69\x6e\x2e\x30\x30\x30\x30\x30\x33\x8c\x06\x00\x00\x00\x02\x72\x02\x92\xc3\xe8\xb7\xc9\x61\x00"; diff --git a/src/connector/src/parser/debezium/simd_json_parser.rs b/src/connector/src/parser/debezium/simd_json_parser.rs index f61545a5443fc..c177d26dad2a5 100644 --- a/src/connector/src/parser/debezium/simd_json_parser.rs +++ b/src/connector/src/parser/debezium/simd_json_parser.rs @@ -89,8 +89,6 @@ impl AccessBuilder for DebeziumMongoJsonAccessBuilder { #[cfg(test)] mod tests { - use std::convert::TryInto; - use chrono::{NaiveDate, NaiveTime}; use risingwave_common::array::{Op, StructValue}; use risingwave_common::catalog::ColumnId; diff --git a/src/connector/src/parser/protobuf/parser.rs b/src/connector/src/parser/protobuf/parser.rs index e9ae317ca5ebc..7dcb502b1f674 100644 --- a/src/connector/src/parser/protobuf/parser.rs +++ b/src/connector/src/parser/protobuf/parser.rs @@ -583,7 +583,7 @@ mod test { use std::path::PathBuf; use prost::Message; - use risingwave_common::types::{DataType, ListValue, StructType}; + use risingwave_common::types::StructType; use risingwave_pb::catalog::StreamSourceInfo; use risingwave_pb::data::data_type::PbTypeName; use risingwave_pb::plan_common::{PbEncodeType, PbFormatType}; diff --git a/src/connector/src/parser/unified/avro.rs b/src/connector/src/parser/unified/avro.rs index 4e7d134f42554..257ca2926c342 100644 --- a/src/connector/src/parser/unified/avro.rs +++ b/src/connector/src/parser/unified/avro.rs @@ -431,7 +431,7 @@ pub(crate) fn unix_epoch_days() -> i32 { #[cfg(test)] mod tests { use apache_avro::Decimal as AvroDecimal; - use risingwave_common::types::{Decimal, Timestamptz}; + use risingwave_common::types::Decimal; use super::*; diff --git a/src/connector/src/sink/encoder/json.rs b/src/connector/src/sink/encoder/json.rs index bbd424d5db036..1064924e60120 100644 --- a/src/connector/src/sink/encoder/json.rs +++ b/src/connector/src/sink/encoder/json.rs @@ -459,8 +459,8 @@ fn type_as_json_schema(rw_type: &DataType) -> Map { mod tests { use risingwave_common::types::{ - DataType, Date, Decimal, Interval, Scalar, ScalarImpl, StructRef, StructType, StructValue, - Time, Timestamp, + Date, Decimal, Interval, Scalar, ScalarImpl, StructRef, StructType, StructValue, Time, + Timestamp, }; use super::*; diff --git a/src/connector/src/sink/redis.rs b/src/connector/src/sink/redis.rs index 96b524d5b7b21..f8be3a5e38eec 100644 --- a/src/connector/src/sink/redis.rs +++ b/src/connector/src/sink/redis.rs @@ -356,8 +356,8 @@ mod test { use std::collections::BTreeMap; use rdkafka::message::FromBytes; - use risingwave_common::array::{Array, I32Array, Op, StreamChunk, Utf8Array}; - use risingwave_common::catalog::{Field, Schema}; + use risingwave_common::array::{Array, I32Array, Op, Utf8Array}; + use risingwave_common::catalog::Field; use risingwave_common::types::DataType; use risingwave_common::util::iter_util::ZipEqDebug; diff --git a/src/connector/src/sink/snowflake_connector.rs b/src/connector/src/sink/snowflake_connector.rs index 30c74045441a2..2ed4d00cf7a26 100644 --- a/src/connector/src/sink/snowflake_connector.rs +++ b/src/connector/src/sink/snowflake_connector.rs @@ -15,7 +15,6 @@ use std::collections::HashMap; use std::time::{SystemTime, UNIX_EPOCH}; -use aws_config; use aws_config::meta::region::RegionProviderChain; use aws_sdk_s3::config::Credentials; use aws_sdk_s3::primitives::ByteStream; diff --git a/src/connector/src/source/kafka/mod.rs b/src/connector/src/source/kafka/mod.rs index 55f84ea4f75a7..0485e0bfc98fd 100644 --- a/src/connector/src/source/kafka/mod.rs +++ b/src/connector/src/source/kafka/mod.rs @@ -189,8 +189,6 @@ impl RdKafkaPropertiesConsumer { #[cfg(test)] mod test { - use std::collections::HashMap; - use maplit::hashmap; use super::*; diff --git a/src/connector/src/source/kinesis/enumerator/client.rs b/src/connector/src/source/kinesis/enumerator/client.rs index b8966f99ae1ac..840def08f6855 100644 --- a/src/connector/src/source/kinesis/enumerator/client.rs +++ b/src/connector/src/source/kinesis/enumerator/client.rs @@ -19,7 +19,7 @@ use aws_sdk_kinesis::Client as kinesis_client; use risingwave_common::bail; use crate::error::ConnectorResult as Result; -use crate::source::kinesis::split::{KinesisOffset, KinesisSplit}; +use crate::source::kinesis::split::KinesisOffset; use crate::source::kinesis::*; use crate::source::{SourceEnumeratorContextRef, SplitEnumerator}; diff --git a/src/connector/src/source/kinesis/mod.rs b/src/connector/src/source/kinesis/mod.rs index 019cefb500643..de393a5121961 100644 --- a/src/connector/src/source/kinesis/mod.rs +++ b/src/connector/src/source/kinesis/mod.rs @@ -65,8 +65,6 @@ impl crate::source::UnknownFields for KinesisProperties { #[cfg(test)] mod test { - use std::collections::HashMap; - use maplit::hashmap; use super::*; diff --git a/src/connector/src/source/kinesis/source/reader.rs b/src/connector/src/source/kinesis/source/reader.rs index 959940bd84415..395856ff98d32 100644 --- a/src/connector/src/source/kinesis/source/reader.rs +++ b/src/connector/src/source/kinesis/source/reader.rs @@ -24,7 +24,6 @@ use aws_sdk_kinesis::Client as KinesisClient; use futures_async_stream::try_stream; use risingwave_common::bail; use thiserror_ext::AsReport; -use tokio_retry; use crate::error::ConnectorResult as Result; use crate::parser::ParserConfig; @@ -306,7 +305,6 @@ mod tests { use super::*; use crate::connector_common::KinesisCommon; - use crate::source::kinesis::split::KinesisSplit; #[tokio::test] async fn test_reject_redundant_seq_props() { diff --git a/src/connector/src/source/nats/source/message.rs b/src/connector/src/source/nats/source/message.rs index 3944cd6bd4c71..55c91457d4bfc 100644 --- a/src/connector/src/source/nats/source/message.rs +++ b/src/connector/src/source/nats/source/message.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use async_nats; use async_nats::jetstream::Message; use crate::source::base::SourceMessage; diff --git a/src/connector/src/source/nexmark/source/reader.rs b/src/connector/src/source/nexmark/source/reader.rs index 7b402cbc13680..7b1d0a43dcb7a 100644 --- a/src/connector/src/source/nexmark/source/reader.rs +++ b/src/connector/src/source/nexmark/source/reader.rs @@ -210,7 +210,7 @@ impl NexmarkSplitReader { #[cfg(test)] mod tests { use super::*; - use crate::source::nexmark::{NexmarkProperties, NexmarkSplitEnumerator}; + use crate::source::nexmark::NexmarkSplitEnumerator; use crate::source::{SourceEnumeratorContext, SplitEnumerator}; #[tokio::test] diff --git a/src/ctl/src/cmd_impl/compute.rs b/src/ctl/src/cmd_impl/compute.rs index 0150c00058773..ff519efcfffa7 100644 --- a/src/ctl/src/cmd_impl/compute.rs +++ b/src/ctl/src/cmd_impl/compute.rs @@ -11,12 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -use std::convert::TryFrom; use risingwave_common::config::{BatchConfig, StreamingConfig}; use risingwave_common::util::addr::HostAddr; use risingwave_rpc_client::ComputeClient; -use serde_json; pub async fn show_config(host: &str) -> anyhow::Result<()> { let listen_addr = HostAddr::try_from(host)?; diff --git a/src/ctl/src/cmd_impl/meta/reschedule.rs b/src/ctl/src/cmd_impl/meta/reschedule.rs index 64d3e229c9112..8d0a45be842fb 100644 --- a/src/ctl/src/cmd_impl/meta/reschedule.rs +++ b/src/ctl/src/cmd_impl/meta/reschedule.rs @@ -24,7 +24,6 @@ use risingwave_pb::meta::get_reschedule_plan_request::PbPolicy; use risingwave_pb::meta::table_fragments::ActorStatus; use risingwave_pb::meta::{GetClusterInfoResponse, GetReschedulePlanResponse, Reschedule}; use serde::{Deserialize, Serialize}; -use serde_yaml; use thiserror_ext::AsReport; use crate::CtlContext; diff --git a/src/ctl/src/cmd_impl/scale/resize.rs b/src/ctl/src/cmd_impl/scale/resize.rs index 6ef0b3c15d7e1..6b990c7865519 100644 --- a/src/ctl/src/cmd_impl/scale/resize.rs +++ b/src/ctl/src/cmd_impl/scale/resize.rs @@ -24,7 +24,6 @@ use risingwave_pb::meta::get_reschedule_plan_request::{ use risingwave_pb::meta::update_worker_node_schedulability_request::Schedulability; use risingwave_pb::meta::{GetClusterInfoResponse, GetReschedulePlanResponse}; use risingwave_stream::task::FragmentId; -use serde_yaml; use thiserror_ext::AsReport; use crate::cmd_impl::meta::ReschedulePayload; diff --git a/src/dml/src/dml_manager.rs b/src/dml/src/dml_manager.rs index f6611b6c94c21..d3502f1f9d2de 100644 --- a/src/dml/src/dml_manager.rs +++ b/src/dml/src/dml_manager.rs @@ -170,7 +170,6 @@ mod tests { use risingwave_common::array::StreamChunk; use risingwave_common::catalog::INITIAL_TABLE_VERSION_ID; use risingwave_common::test_prelude::StreamChunkTestExt; - use risingwave_common::transaction::transaction_id::TxnId; use risingwave_common::types::DataType; use super::*; diff --git a/src/dml/src/table.rs b/src/dml/src/table.rs index 4981ebce2e8a3..a5d0ecf8c23a4 100644 --- a/src/dml/src/table.rs +++ b/src/dml/src/table.rs @@ -283,14 +283,11 @@ impl TableStreamReader { #[cfg(test)] mod tests { - use std::sync::Arc; - use assert_matches::assert_matches; use futures::StreamExt; use itertools::Itertools; - use risingwave_common::array::{Array, I64Array, Op, StreamChunk}; + use risingwave_common::array::{Array, I64Array, Op}; use risingwave_common::catalog::ColumnId; - use risingwave_common::transaction::transaction_id::TxnId; use risingwave_common::types::DataType; use super::*; diff --git a/src/error/src/macros.rs b/src/error/src/macros.rs index b3079aa281ce9..16a11d2dba4d6 100644 --- a/src/error/src/macros.rs +++ b/src/error/src/macros.rs @@ -149,9 +149,6 @@ pub use must_match; #[cfg(test)] mod ensure_tests { - use std::convert::Into; - use std::result::Result::Err; - use anyhow::anyhow; use thiserror::Error; diff --git a/src/expr/core/src/expr/and_or.rs b/src/expr/core/src/expr/and_or.rs index fac820a61b5b3..f265a8a208d29 100644 --- a/src/expr/core/src/expr/and_or.rs +++ b/src/expr/core/src/expr/and_or.rs @@ -142,9 +142,6 @@ fn or(l: Option, r: Option) -> Option { #[cfg(test)] mod tests { - use risingwave_common::array::DataChunk; - use risingwave_common::test_prelude::DataChunkTestExt; - use super::*; use crate::expr::build_from_pretty; diff --git a/src/expr/core/src/expr/expr_literal.rs b/src/expr/core/src/expr/expr_literal.rs index ff6fdb79197a2..e85e6f03af6d7 100644 --- a/src/expr/core/src/expr/expr_literal.rs +++ b/src/expr/core/src/expr/expr_literal.rs @@ -96,7 +96,6 @@ mod tests { use risingwave_pb::data::{PbDataType, PbDatum}; use risingwave_pb::expr::expr_node::RexNode::{self, Constant}; use risingwave_pb::expr::expr_node::Type; - use risingwave_pb::expr::ExprNode; use super::*; diff --git a/src/expr/core/src/expr/expr_some_all.rs b/src/expr/core/src/expr/expr_some_all.rs index 9250aa6d877cf..3f7bc7abbc9f5 100644 --- a/src/expr/core/src/expr/expr_some_all.rs +++ b/src/expr/core/src/expr/expr_some_all.rs @@ -272,7 +272,6 @@ impl Build for SomeAllExpression { #[cfg(test)] mod tests { - use risingwave_common::array::DataChunk; use risingwave_common::row::Row; use risingwave_common::test_prelude::DataChunkTestExt; use risingwave_common::types::ToOwnedDatum; diff --git a/src/expr/core/src/expr/expr_udf.rs b/src/expr/core/src/expr/expr_udf.rs index 4e63dc5950bbe..85399c654c047 100644 --- a/src/expr/core/src/expr/expr_udf.rs +++ b/src/expr/core/src/expr/expr_udf.rs @@ -13,7 +13,6 @@ // limitations under the License. use std::collections::HashMap; -use std::convert::TryFrom; use std::sync::atomic::{AtomicU8, Ordering}; use std::sync::{Arc, LazyLock, Weak}; use std::time::Duration; diff --git a/src/expr/core/src/table_function/user_defined.rs b/src/expr/core/src/table_function/user_defined.rs index 0d1d726c394c7..b98d884b7904c 100644 --- a/src/expr/core/src/table_function/user_defined.rs +++ b/src/expr/core/src/table_function/user_defined.rs @@ -22,7 +22,7 @@ use arrow_udf_js::{CallMode as JsCallMode, Runtime as JsRuntime}; use arrow_udf_python::{CallMode as PythonCallMode, Runtime as PythonRuntime}; use cfg_or_panic::cfg_or_panic; use futures_util::stream; -use risingwave_common::array::{ArrayError, DataChunk, I32Array}; +use risingwave_common::array::{ArrayError, I32Array}; use risingwave_common::bail; use thiserror_ext::AsReport; diff --git a/src/expr/impl/benches/expr.rs b/src/expr/impl/benches/expr.rs index 8468ae86e241b..e04bc9faee35e 100644 --- a/src/expr/impl/benches/expr.rs +++ b/src/expr/impl/benches/expr.rs @@ -29,7 +29,6 @@ use risingwave_common::types::*; use risingwave_expr::aggregate::{build_append_only, AggArgs, AggCall, AggKind}; use risingwave_expr::expr::*; use risingwave_expr::sig::FUNCTION_REGISTRY; -use risingwave_expr::ExprError; use risingwave_pb::expr::expr_node::PbType; use thiserror_ext::AsReport; diff --git a/src/expr/impl/src/aggregate/general.rs b/src/expr/impl/src/aggregate/general.rs index 2ee55f0a16d52..8c006377642bf 100644 --- a/src/expr/impl/src/aggregate/general.rs +++ b/src/expr/impl/src/aggregate/general.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::convert::From; - use num_traits::{CheckedAdd, CheckedSub}; use risingwave_expr::{aggregate, ExprError, Result}; diff --git a/src/expr/impl/src/scalar/arithmetic_op.rs b/src/expr/impl/src/scalar/arithmetic_op.rs index ad5fe8497d8bb..e48b0b5e94b59 100644 --- a/src/expr/impl/src/scalar/arithmetic_op.rs +++ b/src/expr/impl/src/scalar/arithmetic_op.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::convert::TryInto; use std::fmt::Debug; use chrono::{Duration, NaiveDateTime}; @@ -443,9 +442,7 @@ mod tests { use num_traits::Float; use risingwave_common::types::test_utils::IntervalTestExt; - use risingwave_common::types::{ - Date, Decimal, Int256, Int256Ref, Interval, Scalar, Timestamp, F32, F64, - }; + use risingwave_common::types::{Int256, Int256Ref, Scalar, F32}; use super::*; diff --git a/src/expr/impl/src/scalar/bitwise_op.rs b/src/expr/impl/src/scalar/bitwise_op.rs index 38aa4d194ea60..0d7f14bb6965a 100644 --- a/src/expr/impl/src/scalar/bitwise_op.rs +++ b/src/expr/impl/src/scalar/bitwise_op.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. use std::any::type_name; -use std::convert::TryInto; use std::fmt::Debug; use std::ops::{BitAnd, BitOr, BitXor, Not}; diff --git a/src/expr/impl/src/scalar/case.rs b/src/expr/impl/src/scalar/case.rs index 99ec8cb880ddc..f7fb9d89ef41b 100644 --- a/src/expr/impl/src/scalar/case.rs +++ b/src/expr/impl/src/scalar/case.rs @@ -285,7 +285,6 @@ fn build_case_expr( #[cfg(test)] mod tests { - use risingwave_common::row::Row; use risingwave_common::test_prelude::DataChunkTestExt; use risingwave_common::types::ToOwnedDatum; use risingwave_common::util::iter_util::ZipEqDebug; diff --git a/src/expr/impl/src/scalar/cast.rs b/src/expr/impl/src/scalar/cast.rs index bff225ad687ff..bbebf3a483d51 100644 --- a/src/expr/impl/src/scalar/cast.rs +++ b/src/expr/impl/src/scalar/cast.rs @@ -245,11 +245,9 @@ fn struct_cast(input: StructRef<'_>, ctx: &Context) -> Result { #[cfg(test)] mod tests { use chrono::NaiveDateTime; - use itertools::Itertools; use risingwave_common::array::*; use risingwave_common::types::*; use risingwave_expr::expr::build_from_pretty; - use risingwave_pb::expr::expr_node::PbType; use super::*; diff --git a/src/expr/impl/src/scalar/proctime.rs b/src/expr/impl/src/scalar/proctime.rs index 2e96e602633cb..2c3c2c651c3df 100644 --- a/src/expr/impl/src/scalar/proctime.rs +++ b/src/expr/impl/src/scalar/proctime.rs @@ -25,7 +25,6 @@ fn proctime() -> Result { #[cfg(test)] mod tests { - use risingwave_common::types::Timestamptz; use risingwave_common::util::epoch::{Epoch, EpochPair}; use super::*; diff --git a/src/expr/impl/src/scalar/round.rs b/src/expr/impl/src/scalar/round.rs index a43dd425e13c3..90c9512c6c9b2 100644 --- a/src/expr/impl/src/scalar/round.rs +++ b/src/expr/impl/src/scalar/round.rs @@ -73,9 +73,6 @@ pub fn round_decimal(input: Decimal) -> Decimal { mod tests { use std::str::FromStr; - use risingwave_common::types::{Decimal, F64}; - - use super::ceil_f64; use crate::scalar::round::*; fn do_test(input: &str, digits: i32, expected_output: Option<&str>) { diff --git a/src/expr/impl/src/scalar/trigonometric.rs b/src/expr/impl/src/scalar/trigonometric.rs index 705ee8f3eeba2..20e2b3523716b 100644 --- a/src/expr/impl/src/scalar/trigonometric.rs +++ b/src/expr/impl/src/scalar/trigonometric.rs @@ -362,7 +362,7 @@ pub fn radians_f64(input: F64) -> F64 { mod tests { use std::f64::consts::PI; - use risingwave_common::types::{FloatExt, F64}; + use risingwave_common::types::FloatExt; use crate::scalar::trigonometric::*; diff --git a/src/frontend/src/binder/expr/value.rs b/src/frontend/src/binder/expr/value.rs index 0b6eace27083f..a0758a15d4440 100644 --- a/src/frontend/src/binder/expr/value.rs +++ b/src/frontend/src/binder/expr/value.rs @@ -221,13 +221,12 @@ impl Binder { #[cfg(test)] mod tests { use risingwave_common::types::test_utils::IntervalTestExt; - use risingwave_common::types::DataType; use risingwave_expr::expr::build_from_prost; use risingwave_sqlparser::ast::Value::Number; use super::*; use crate::binder::test_utils::mock_binder; - use crate::expr::{Expr, ExprImpl, ExprType, FunctionCall}; + use crate::expr::Expr; #[tokio::test] async fn test_bind_value() { diff --git a/src/frontend/src/binder/values.rs b/src/frontend/src/binder/values.rs index 93f9e3f4f8a18..9e190c3cf4dc5 100644 --- a/src/frontend/src/binder/values.rs +++ b/src/frontend/src/binder/values.rs @@ -154,7 +154,7 @@ impl Binder { #[cfg(test)] mod tests { - use risingwave_common::util::iter_util::{zip_eq_fast, ZipEqFast}; + use risingwave_common::util::iter_util::zip_eq_fast; use risingwave_sqlparser::ast::{Expr, Value}; use super::*; diff --git a/src/frontend/src/catalog/table_catalog.rs b/src/frontend/src/catalog/table_catalog.rs index 10ce56a1060cf..c128a44cfe3ff 100644 --- a/src/frontend/src/catalog/table_catalog.rs +++ b/src/frontend/src/catalog/table_catalog.rs @@ -572,19 +572,15 @@ impl OwnedByUserCatalog for TableCatalog { #[cfg(test)] mod tests { - use risingwave_common::catalog::{ - row_id_column_desc, ColumnCatalog, ColumnDesc, ColumnId, TableId, - }; + use risingwave_common::catalog::{row_id_column_desc, ColumnDesc, ColumnId}; use risingwave_common::test_prelude::*; use risingwave_common::types::*; use risingwave_common::util::sort_util::OrderType; - use risingwave_pb::catalog::{PbStreamJobStatus, PbTable}; use risingwave_pb::plan_common::{ AdditionalColumn, ColumnDescVersion, PbColumnCatalog, PbColumnDesc, }; use super::*; - use crate::catalog::table_catalog::{TableCatalog, TableType}; #[test] fn test_into_table_catalog() { diff --git a/src/frontend/src/handler/create_function.rs b/src/frontend/src/handler/create_function.rs index cb2a88c64cf37..abde79dd04860 100644 --- a/src/frontend/src/handler/create_function.rs +++ b/src/frontend/src/handler/create_function.rs @@ -15,14 +15,11 @@ use anyhow::{anyhow, Context}; use arrow_schema::Fields; use bytes::Bytes; -use itertools::Itertools; -use pgwire::pg_response::StatementType; use risingwave_common::catalog::FunctionId; use risingwave_common::types::DataType; use risingwave_expr::expr::get_or_create_wasm_runtime; use risingwave_pb::catalog::function::{Kind, ScalarFunction, TableFunction}; use risingwave_pb::catalog::Function; -use risingwave_sqlparser::ast::{CreateFunctionBody, ObjectName, OperateFunctionArg}; use risingwave_udf::ArrowFlightUdfClient; use super::*; diff --git a/src/frontend/src/handler/create_sql_function.rs b/src/frontend/src/handler/create_sql_function.rs index f4c683b4d7a0e..877dea502f029 100644 --- a/src/frontend/src/handler/create_sql_function.rs +++ b/src/frontend/src/handler/create_sql_function.rs @@ -15,15 +15,10 @@ use std::collections::HashMap; use fancy_regex::Regex; -use itertools::Itertools; -use pgwire::pg_response::StatementType; use risingwave_common::catalog::FunctionId; use risingwave_common::types::DataType; use risingwave_pb::catalog::function::{Kind, ScalarFunction, TableFunction}; use risingwave_pb::catalog::Function; -use risingwave_sqlparser::ast::{ - CreateFunctionBody, FunctionDefinition, ObjectName, OperateFunctionArg, -}; use risingwave_sqlparser::parser::{Parser, ParserError}; use super::*; diff --git a/src/frontend/src/handler/create_table.rs b/src/frontend/src/handler/create_table.rs index 9e93d843401cb..0c6555e766d18 100644 --- a/src/frontend/src/handler/create_table.rs +++ b/src/frontend/src/handler/create_table.rs @@ -1195,15 +1195,10 @@ pub async fn generate_stream_graph_for_table( #[cfg(test)] mod tests { - use std::collections::HashMap; - - use risingwave_common::catalog::{ - Field, DEFAULT_DATABASE_NAME, DEFAULT_SCHEMA_NAME, ROWID_PREFIX, - }; + use risingwave_common::catalog::{Field, DEFAULT_DATABASE_NAME, ROWID_PREFIX}; use risingwave_common::types::DataType; use super::*; - use crate::catalog::root_catalog::SchemaPath; use crate::test_utils::{create_proto_file, LocalFrontend, PROTO_FILE_DATA}; #[test] diff --git a/src/frontend/src/handler/drop_function.rs b/src/frontend/src/handler/drop_function.rs index 61eaa8d0c0ad0..bd6ad11b7d5c5 100644 --- a/src/frontend/src/handler/drop_function.rs +++ b/src/frontend/src/handler/drop_function.rs @@ -12,9 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use pgwire::pg_response::StatementType; -use risingwave_sqlparser::ast::{FunctionDesc, ReferentialAction}; - use super::*; use crate::catalog::root_catalog::SchemaPath; use crate::catalog::CatalogError; diff --git a/src/frontend/src/handler/show.rs b/src/frontend/src/handler/show.rs index dfeeb0965ad64..98348513c3b8b 100644 --- a/src/frontend/src/handler/show.rs +++ b/src/frontend/src/handler/show.rs @@ -29,7 +29,6 @@ use risingwave_pb::catalog::connection; use risingwave_sqlparser::ast::{ display_comma_separated, Ident, ObjectName, ShowCreateType, ShowObject, ShowStatementFilter, }; -use serde_json; use super::{fields_to_descriptors, RwPgResponse, RwPgResponseBuilderExt}; use crate::binder::{Binder, Relation}; diff --git a/src/frontend/src/handler/util.rs b/src/frontend/src/handler/util.rs index d3ccb55e6a6ab..30d592c632dab 100644 --- a/src/frontend/src/handler/util.rs +++ b/src/frontend/src/handler/util.rs @@ -193,10 +193,8 @@ impl CompatibleSourceSchema { #[cfg(test)] mod tests { - use bytes::BytesMut; use postgres_types::{ToSql, Type}; use risingwave_common::array::*; - use risingwave_common::types::Timestamptz; use super::*; diff --git a/src/frontend/src/optimizer/mod.rs b/src/frontend/src/optimizer/mod.rs index c498f43b95208..8877037e4eea1 100644 --- a/src/frontend/src/optimizer/mod.rs +++ b/src/frontend/src/optimizer/mod.rs @@ -1019,11 +1019,7 @@ fn require_additional_exchange_on_root_in_local_mode(plan: PlanRef) -> bool { #[cfg(test)] mod tests { - use risingwave_common::catalog::Field; - use risingwave_common::types::DataType; - use super::*; - use crate::optimizer::optimizer_context::OptimizerContext; use crate::optimizer::plan_node::LogicalValues; #[tokio::test] diff --git a/src/frontend/src/optimizer/optimizer_context.rs b/src/frontend/src/optimizer/optimizer_context.rs index 215b0aaf8bcb9..8cabb53a8cadf 100644 --- a/src/frontend/src/optimizer/optimizer_context.rs +++ b/src/frontend/src/optimizer/optimizer_context.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use core::convert::Into; use core::fmt::Formatter; use std::cell::{RefCell, RefMut}; use std::rc::Rc; diff --git a/src/frontend/src/optimizer/plan_node/batch_delete.rs b/src/frontend/src/optimizer/plan_node/batch_delete.rs index 62499a495d1de..8980f58a9e2c4 100644 --- a/src/frontend/src/optimizer/plan_node/batch_delete.rs +++ b/src/frontend/src/optimizer/plan_node/batch_delete.rs @@ -22,7 +22,6 @@ use super::{ }; use crate::error::Result; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; -use crate::optimizer::plan_node::generic::PhysicalPlanRef; use crate::optimizer::plan_node::{utils, ToLocalBatch}; use crate::optimizer::plan_visitor::DistributedDmlVisitor; use crate::optimizer::property::{Distribution, Order, RequiredDist}; diff --git a/src/frontend/src/optimizer/plan_node/batch_hash_agg.rs b/src/frontend/src/optimizer/plan_node/batch_hash_agg.rs index af5f4c4accbb6..341d1281009eb 100644 --- a/src/frontend/src/optimizer/plan_node/batch_hash_agg.rs +++ b/src/frontend/src/optimizer/plan_node/batch_hash_agg.rs @@ -17,7 +17,7 @@ use risingwave_pb::batch_plan::plan_node::NodeBody; use risingwave_pb::batch_plan::HashAggNode; use super::batch::prelude::*; -use super::generic::{self, GenericPlanRef, PlanAggCall}; +use super::generic::{self, PlanAggCall}; use super::utils::impl_distill_by_unit; use super::{ ExprRewritable, PlanBase, PlanNodeType, PlanRef, PlanTreeNodeUnary, ToBatchPb, diff --git a/src/frontend/src/optimizer/plan_node/batch_hash_join.rs b/src/frontend/src/optimizer/plan_node/batch_hash_join.rs index 8b92f722490d5..399817336e4ca 100644 --- a/src/frontend/src/optimizer/plan_node/batch_hash_join.rs +++ b/src/frontend/src/optimizer/plan_node/batch_hash_join.rs @@ -18,10 +18,9 @@ use risingwave_pb::batch_plan::HashJoinNode; use risingwave_pb::plan_common::JoinType; use super::batch::prelude::*; -use super::generic::{self, GenericPlanRef}; use super::utils::{childless_record, Distill}; use super::{ - EqJoinPredicate, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeBinary, ToBatchPb, + generic, EqJoinPredicate, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeBinary, ToBatchPb, ToDistributedBatch, }; use crate::error::Result; diff --git a/src/frontend/src/optimizer/plan_node/batch_insert.rs b/src/frontend/src/optimizer/plan_node/batch_insert.rs index 1dbe387bb708f..8a3e511efc83c 100644 --- a/src/frontend/src/optimizer/plan_node/batch_insert.rs +++ b/src/frontend/src/optimizer/plan_node/batch_insert.rs @@ -18,7 +18,6 @@ use risingwave_pb::batch_plan::InsertNode; use risingwave_pb::plan_common::{DefaultColumns, IndexAndExpr}; use super::batch::prelude::*; -use super::generic::GenericPlanRef; use super::utils::{childless_record, Distill}; use super::{generic, ExprRewritable, PlanRef, PlanTreeNodeUnary, ToBatchPb, ToDistributedBatch}; use crate::error::Result; diff --git a/src/frontend/src/optimizer/plan_node/batch_limit.rs b/src/frontend/src/optimizer/plan_node/batch_limit.rs index 1dfe9215be1ea..ef717d179130e 100644 --- a/src/frontend/src/optimizer/plan_node/batch_limit.rs +++ b/src/frontend/src/optimizer/plan_node/batch_limit.rs @@ -16,7 +16,6 @@ use risingwave_pb::batch_plan::plan_node::NodeBody; use risingwave_pb::batch_plan::LimitNode; use super::batch::prelude::*; -use super::generic::PhysicalPlanRef; use super::utils::impl_distill_by_unit; use super::{ generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, ToBatchPb, ToDistributedBatch, diff --git a/src/frontend/src/optimizer/plan_node/batch_lookup_join.rs b/src/frontend/src/optimizer/plan_node/batch_lookup_join.rs index a20b4ad316cd7..a181c590e0e65 100644 --- a/src/frontend/src/optimizer/plan_node/batch_lookup_join.rs +++ b/src/frontend/src/optimizer/plan_node/batch_lookup_join.rs @@ -18,9 +18,8 @@ use risingwave_pb::batch_plan::plan_node::NodeBody; use risingwave_pb::batch_plan::{DistributedLookupJoinNode, LocalLookupJoinNode}; use super::batch::prelude::*; -use super::generic::{self, GenericPlanRef}; use super::utils::{childless_record, Distill}; -use super::ExprRewritable; +use super::{generic, ExprRewritable}; use crate::error::Result; use crate::expr::{Expr, ExprRewriter, ExprVisitor}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; diff --git a/src/frontend/src/optimizer/plan_node/batch_max_one_row.rs b/src/frontend/src/optimizer/plan_node/batch_max_one_row.rs index 94b8b3e6e0483..e35d6976672c4 100644 --- a/src/frontend/src/optimizer/plan_node/batch_max_one_row.rs +++ b/src/frontend/src/optimizer/plan_node/batch_max_one_row.rs @@ -17,7 +17,7 @@ use risingwave_pb::batch_plan::plan_node::NodeBody; use risingwave_pb::batch_plan::MaxOneRowNode; use super::batch::prelude::*; -use super::generic::{DistillUnit, PhysicalPlanRef}; +use super::generic::DistillUnit; use super::utils::Distill; use super::{ generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, ToBatchPb, ToDistributedBatch, diff --git a/src/frontend/src/optimizer/plan_node/batch_nested_loop_join.rs b/src/frontend/src/optimizer/plan_node/batch_nested_loop_join.rs index 401166b1a298a..5d07aad86017b 100644 --- a/src/frontend/src/optimizer/plan_node/batch_nested_loop_join.rs +++ b/src/frontend/src/optimizer/plan_node/batch_nested_loop_join.rs @@ -17,9 +17,10 @@ use risingwave_pb::batch_plan::plan_node::NodeBody; use risingwave_pb::batch_plan::NestedLoopJoinNode; use super::batch::prelude::*; -use super::generic::{self, GenericPlanRef}; use super::utils::{childless_record, Distill}; -use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeBinary, ToBatchPb, ToDistributedBatch}; +use super::{ + generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeBinary, ToBatchPb, ToDistributedBatch, +}; use crate::error::Result; use crate::expr::{Expr, ExprImpl, ExprRewriter, ExprVisitor}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; diff --git a/src/frontend/src/optimizer/plan_node/batch_over_window.rs b/src/frontend/src/optimizer/plan_node/batch_over_window.rs index 1712e87bbabbf..b9355fb117098 100644 --- a/src/frontend/src/optimizer/plan_node/batch_over_window.rs +++ b/src/frontend/src/optimizer/plan_node/batch_over_window.rs @@ -17,7 +17,6 @@ use risingwave_pb::batch_plan::plan_node::NodeBody; use risingwave_pb::batch_plan::SortOverWindowNode; use super::batch::prelude::*; -use super::batch::BatchPlanRef; use super::generic::PlanWindowFunction; use super::utils::impl_distill_by_unit; use super::{ diff --git a/src/frontend/src/optimizer/plan_node/batch_simple_agg.rs b/src/frontend/src/optimizer/plan_node/batch_simple_agg.rs index a112e36c3a98f..ff20df7a4d177 100644 --- a/src/frontend/src/optimizer/plan_node/batch_simple_agg.rs +++ b/src/frontend/src/optimizer/plan_node/batch_simple_agg.rs @@ -16,7 +16,7 @@ use risingwave_pb::batch_plan::plan_node::NodeBody; use risingwave_pb::batch_plan::SortAggNode; use super::batch::prelude::*; -use super::generic::{self, GenericPlanRef, PlanAggCall}; +use super::generic::{self, PlanAggCall}; use super::utils::impl_distill_by_unit; use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, ToBatchPb, ToDistributedBatch}; use crate::error::Result; diff --git a/src/frontend/src/optimizer/plan_node/batch_sort.rs b/src/frontend/src/optimizer/plan_node/batch_sort.rs index 413103ee98c89..9136e3f7c685a 100644 --- a/src/frontend/src/optimizer/plan_node/batch_sort.rs +++ b/src/frontend/src/optimizer/plan_node/batch_sort.rs @@ -17,7 +17,6 @@ use risingwave_pb::batch_plan::plan_node::NodeBody; use risingwave_pb::batch_plan::SortNode; use super::batch::prelude::*; -use super::batch::BatchPlanRef; use super::utils::{childless_record, Distill}; use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, ToBatchPb, ToDistributedBatch}; use crate::error::Result; diff --git a/src/frontend/src/optimizer/plan_node/batch_sort_agg.rs b/src/frontend/src/optimizer/plan_node/batch_sort_agg.rs index 7393c10edc8f0..f8ea17dcd837e 100644 --- a/src/frontend/src/optimizer/plan_node/batch_sort_agg.rs +++ b/src/frontend/src/optimizer/plan_node/batch_sort_agg.rs @@ -17,7 +17,7 @@ use risingwave_pb::batch_plan::SortAggNode; use risingwave_pb::expr::ExprNode; use super::batch::prelude::*; -use super::generic::{self, GenericPlanRef, PlanAggCall}; +use super::generic::{self, PlanAggCall}; use super::utils::impl_distill_by_unit; use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, ToBatchPb, ToDistributedBatch}; use crate::error::Result; diff --git a/src/frontend/src/optimizer/plan_node/batch_topn.rs b/src/frontend/src/optimizer/plan_node/batch_topn.rs index d8f96668f88a7..643ef0fcc01fc 100644 --- a/src/frontend/src/optimizer/plan_node/batch_topn.rs +++ b/src/frontend/src/optimizer/plan_node/batch_topn.rs @@ -22,7 +22,6 @@ use super::{ generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, ToBatchPb, ToDistributedBatch, }; use crate::error::Result; -use crate::optimizer::plan_node::batch::BatchPlanRef; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; use crate::optimizer::plan_node::{BatchLimit, ToLocalBatch}; use crate::optimizer::property::{Order, RequiredDist}; diff --git a/src/frontend/src/optimizer/plan_node/batch_update.rs b/src/frontend/src/optimizer/plan_node/batch_update.rs index 34d1eb3db3d74..d0351e6fdec2e 100644 --- a/src/frontend/src/optimizer/plan_node/batch_update.rs +++ b/src/frontend/src/optimizer/plan_node/batch_update.rs @@ -18,7 +18,6 @@ use risingwave_pb::batch_plan::plan_node::NodeBody; use risingwave_pb::batch_plan::UpdateNode; use super::batch::prelude::*; -use super::generic::GenericPlanRef; use super::utils::impl_distill_by_unit; use super::{ generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, ToBatchPb, ToDistributedBatch, diff --git a/src/frontend/src/optimizer/plan_node/convert.rs b/src/frontend/src/optimizer/plan_node/convert.rs index a39ed7d3b048d..db961b3b1e20a 100644 --- a/src/frontend/src/optimizer/plan_node/convert.rs +++ b/src/frontend/src/optimizer/plan_node/convert.rs @@ -19,8 +19,7 @@ use risingwave_common::catalog::FieldDisplay; use risingwave_pb::stream_plan::StreamScanType; use super::*; -use crate::optimizer::property::{Order, RequiredDist}; -use crate::utils::ColIndexMapping; +use crate::optimizer::property::RequiredDist; use crate::{for_batch_plan_nodes, for_logical_plan_nodes, for_stream_plan_nodes}; /// `ToStream` converts a logical plan node to streaming physical node diff --git a/src/frontend/src/optimizer/plan_node/expr_rewritable.rs b/src/frontend/src/optimizer/plan_node/expr_rewritable.rs index 33deebde1cdf9..4a30a599742ed 100644 --- a/src/frontend/src/optimizer/plan_node/expr_rewritable.rs +++ b/src/frontend/src/optimizer/plan_node/expr_rewritable.rs @@ -12,10 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::ops::Deref; - use super::*; -use crate::expr::ExprRewriter; /// Rewrites expressions in a `PlanRef`. Due to `Share` operator, /// the `ExprRewriter` needs to be idempotent i.e., applying it more than once diff --git a/src/frontend/src/optimizer/plan_node/expr_visitable.rs b/src/frontend/src/optimizer/plan_node/expr_visitable.rs index e4454fa92a7e5..e5527dfa17785 100644 --- a/src/frontend/src/optimizer/plan_node/expr_visitable.rs +++ b/src/frontend/src/optimizer/plan_node/expr_visitable.rs @@ -12,10 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::ops::Deref; - use super::*; -use crate::expr::ExprVisitor; /// Vistis expressions in a `PlanRef`. /// To visit recursively, call `visit_exprs_recursive` on [`VisitExprsRecursive`]. diff --git a/src/frontend/src/optimizer/plan_node/logical_agg.rs b/src/frontend/src/optimizer/plan_node/logical_agg.rs index cad073386a42e..36c4c87c695ce 100644 --- a/src/frontend/src/optimizer/plan_node/logical_agg.rs +++ b/src/frontend/src/optimizer/plan_node/logical_agg.rs @@ -1202,12 +1202,9 @@ impl ToStream for LogicalAgg { #[cfg(test)] mod tests { use risingwave_common::catalog::{Field, Schema}; - use risingwave_common::types::DataType; use super::*; - use crate::expr::{ - assert_eq_input_ref, input_ref_to_column_indices, AggCall, ExprType, FunctionCall, OrderBy, - }; + use crate::expr::{assert_eq_input_ref, input_ref_to_column_indices}; use crate::optimizer::optimizer_context::OptimizerContext; use crate::optimizer::plan_node::LogicalValues; diff --git a/src/frontend/src/optimizer/plan_node/logical_filter.rs b/src/frontend/src/optimizer/plan_node/logical_filter.rs index 6bae6cc7efb22..4ea9adf7aacac 100644 --- a/src/frontend/src/optimizer/plan_node/logical_filter.rs +++ b/src/frontend/src/optimizer/plan_node/logical_filter.rs @@ -247,11 +247,11 @@ mod tests { use std::collections::HashSet; use risingwave_common::catalog::{Field, Schema}; - use risingwave_common::types::{DataType, ScalarImpl}; + use risingwave_common::types::ScalarImpl; use risingwave_pb::expr::expr_node::Type; use super::*; - use crate::expr::{assert_eq_input_ref, FunctionCall, InputRef, Literal}; + use crate::expr::{assert_eq_input_ref, Literal}; use crate::optimizer::optimizer_context::OptimizerContext; use crate::optimizer::plan_node::LogicalValues; use crate::optimizer::property::FunctionalDependency; diff --git a/src/frontend/src/optimizer/plan_node/logical_hop_window.rs b/src/frontend/src/optimizer/plan_node/logical_hop_window.rs index 37f1dba5c2720..b15424d6d892a 100644 --- a/src/frontend/src/optimizer/plan_node/logical_hop_window.rs +++ b/src/frontend/src/optimizer/plan_node/logical_hop_window.rs @@ -366,7 +366,6 @@ mod test { use risingwave_common::types::DataType; use super::*; - use crate::expr::InputRef; use crate::optimizer::optimizer_context::OptimizerContext; use crate::optimizer::plan_node::LogicalValues; use crate::optimizer::property::FunctionalDependency; diff --git a/src/frontend/src/optimizer/plan_node/logical_join.rs b/src/frontend/src/optimizer/plan_node/logical_join.rs index 47c5238bde2ba..c192d7fee3666 100644 --- a/src/frontend/src/optimizer/plan_node/logical_join.rs +++ b/src/frontend/src/optimizer/plan_node/logical_join.rs @@ -1479,7 +1479,7 @@ mod tests { use risingwave_pb::expr::expr_node::Type; use super::*; - use crate::expr::{assert_eq_input_ref, FunctionCall, InputRef, Literal}; + use crate::expr::{assert_eq_input_ref, FunctionCall, Literal}; use crate::optimizer::optimizer_context::OptimizerContext; use crate::optimizer::plan_node::LogicalValues; use crate::optimizer::property::FunctionalDependency; diff --git a/src/frontend/src/optimizer/plan_node/logical_multi_join.rs b/src/frontend/src/optimizer/plan_node/logical_multi_join.rs index a47c75d31bd27..a30b78d44e00c 100644 --- a/src/frontend/src/optimizer/plan_node/logical_multi_join.rs +++ b/src/frontend/src/optimizer/plan_node/logical_multi_join.rs @@ -871,7 +871,7 @@ mod test { use risingwave_pb::expr::expr_node::Type; use super::*; - use crate::expr::{FunctionCall, InputRef}; + use crate::expr::InputRef; use crate::optimizer::optimizer_context::OptimizerContext; use crate::optimizer::plan_node::generic::GenericPlanRef; use crate::optimizer::plan_node::LogicalValues; diff --git a/src/frontend/src/optimizer/plan_node/logical_project.rs b/src/frontend/src/optimizer/plan_node/logical_project.rs index a0f26548da2b1..78bd74969b2c1 100644 --- a/src/frontend/src/optimizer/plan_node/logical_project.rs +++ b/src/frontend/src/optimizer/plan_node/logical_project.rs @@ -303,7 +303,7 @@ mod tests { use risingwave_pb::expr::expr_node::Type; use super::*; - use crate::expr::{assert_eq_input_ref, FunctionCall, InputRef, Literal}; + use crate::expr::{assert_eq_input_ref, FunctionCall, Literal}; use crate::optimizer::optimizer_context::OptimizerContext; use crate::optimizer::plan_node::LogicalValues; diff --git a/src/frontend/src/optimizer/plan_node/logical_project_set.rs b/src/frontend/src/optimizer/plan_node/logical_project_set.rs index 53e7995c1517e..984fdac720b90 100644 --- a/src/frontend/src/optimizer/plan_node/logical_project_set.rs +++ b/src/frontend/src/optimizer/plan_node/logical_project_set.rs @@ -412,10 +412,8 @@ mod test { use std::collections::HashSet; use risingwave_common::catalog::{Field, Schema}; - use risingwave_common::types::DataType; use super::*; - use crate::expr::{ExprImpl, InputRef, TableFunction}; use crate::optimizer::optimizer_context::OptimizerContext; use crate::optimizer::plan_node::LogicalValues; use crate::optimizer::property::FunctionalDependency; diff --git a/src/frontend/src/optimizer/plan_node/logical_union.rs b/src/frontend/src/optimizer/plan_node/logical_union.rs index 99de2748dca4e..6238e63fd9f51 100644 --- a/src/frontend/src/optimizer/plan_node/logical_union.rs +++ b/src/frontend/src/optimizer/plan_node/logical_union.rs @@ -327,8 +327,7 @@ impl ToStream for LogicalUnion { #[cfg(test)] mod tests { - use risingwave_common::catalog::{Field, Schema}; - use risingwave_common::types::DataType; + use risingwave_common::catalog::Field; use super::*; use crate::optimizer::optimizer_context::OptimizerContext; diff --git a/src/frontend/src/optimizer/plan_node/logical_values.rs b/src/frontend/src/optimizer/plan_node/logical_values.rs index cdf9af3c93541..7a585f7e0801f 100644 --- a/src/frontend/src/optimizer/plan_node/logical_values.rs +++ b/src/frontend/src/optimizer/plan_node/logical_values.rs @@ -205,11 +205,9 @@ impl ToStream for LogicalValues { #[cfg(test)] mod tests { - use risingwave_common::catalog::Field; - use risingwave_common::types::{DataType, Datum}; + use risingwave_common::types::Datum; use super::*; - use crate::expr::Literal; use crate::optimizer::optimizer_context::OptimizerContext; fn literal(val: i32) -> ExprImpl { diff --git a/src/frontend/src/optimizer/plan_node/mod.rs b/src/frontend/src/optimizer/plan_node/mod.rs index 780e1d2b39cdd..6ed0b3226f0b0 100644 --- a/src/frontend/src/optimizer/plan_node/mod.rs +++ b/src/frontend/src/optimizer/plan_node/mod.rs @@ -33,7 +33,7 @@ use std::ops::Deref; use std::rc::Rc; use downcast_rs::{impl_downcast, Downcast}; -use dyn_clone::{self, DynClone}; +use dyn_clone::DynClone; use fixedbitset::FixedBitSet; use itertools::Itertools; use paste::paste; diff --git a/src/frontend/src/optimizer/plan_node/plan_base.rs b/src/frontend/src/optimizer/plan_node/plan_base.rs index 3e9783894d40f..12fba475241c5 100644 --- a/src/frontend/src/optimizer/plan_node/plan_base.rs +++ b/src/frontend/src/optimizer/plan_node/plan_base.rs @@ -13,13 +13,10 @@ // limitations under the License. use educe::Educe; -use fixedbitset::FixedBitSet; -use risingwave_common::catalog::Schema; use super::generic::GenericPlanNode; use super::*; -use crate::optimizer::optimizer_context::OptimizerContextRef; -use crate::optimizer::property::{Distribution, FunctionalDependencySet, Order}; +use crate::optimizer::property::Distribution; /// No extra fields for logical plan nodes. #[derive(Clone, Debug, PartialEq, Eq, Hash)] diff --git a/src/frontend/src/optimizer/plan_node/predicate_pushdown.rs b/src/frontend/src/optimizer/plan_node/predicate_pushdown.rs index 64abc6bcd2de8..af56ae3f76582 100644 --- a/src/frontend/src/optimizer/plan_node/predicate_pushdown.rs +++ b/src/frontend/src/optimizer/plan_node/predicate_pushdown.rs @@ -19,7 +19,6 @@ use paste::paste; use super::*; use crate::optimizer::plan_visitor::ShareParentCounter; use crate::optimizer::PlanVisitor; -use crate::utils::Condition; use crate::{for_batch_plan_nodes, for_stream_plan_nodes}; /// The trait for predicate pushdown, only logical plan node will use it, though all plan node impl diff --git a/src/frontend/src/optimizer/plan_node/stream_delta_join.rs b/src/frontend/src/optimizer/plan_node/stream_delta_join.rs index 89b1402cba919..49257676bc004 100644 --- a/src/frontend/src/optimizer/plan_node/stream_delta_join.rs +++ b/src/frontend/src/optimizer/plan_node/stream_delta_join.rs @@ -20,10 +20,9 @@ use risingwave_pb::plan_common::JoinType; use risingwave_pb::stream_plan::stream_node::NodeBody; use risingwave_pb::stream_plan::{ArrangementInfo, DeltaIndexJoinNode}; -use super::generic::{self, GenericPlanRef}; use super::stream::prelude::*; use super::utils::{childless_record, Distill}; -use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeBinary}; +use super::{generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeBinary}; use crate::expr::{Expr, ExprRewriter, ExprVisitor}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; use crate::optimizer::plan_node::utils::IndicesDisplay; diff --git a/src/frontend/src/optimizer/plan_node/stream_dml.rs b/src/frontend/src/optimizer/plan_node/stream_dml.rs index bdda75d061012..e777041718291 100644 --- a/src/frontend/src/optimizer/plan_node/stream_dml.rs +++ b/src/frontend/src/optimizer/plan_node/stream_dml.rs @@ -18,7 +18,6 @@ use risingwave_common::catalog::{ColumnDesc, INITIAL_TABLE_VERSION_ID}; use risingwave_pb::stream_plan::stream_node::PbNodeBody; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{childless_record, Distill}; use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, StreamNode}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; diff --git a/src/frontend/src/optimizer/plan_node/stream_dynamic_filter.rs b/src/frontend/src/optimizer/plan_node/stream_dynamic_filter.rs index 974c6fca5df1a..a90cd4b77c669 100644 --- a/src/frontend/src/optimizer/plan_node/stream_dynamic_filter.rs +++ b/src/frontend/src/optimizer/plan_node/stream_dynamic_filter.rs @@ -17,9 +17,8 @@ pub use risingwave_pb::expr::expr_node::Type as ExprType; use risingwave_pb::stream_plan::stream_node::NodeBody; use risingwave_pb::stream_plan::DynamicFilterNode; -use super::generic::{DynamicFilter, GenericPlanRef}; +use super::generic::DynamicFilter; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{ childless_record, column_names_pretty, plan_node_name, watermark_pretty, Distill, }; diff --git a/src/frontend/src/optimizer/plan_node/stream_eowc_over_window.rs b/src/frontend/src/optimizer/plan_node/stream_eowc_over_window.rs index 7cd9bb533a807..78cb0e3b9d605 100644 --- a/src/frontend/src/optimizer/plan_node/stream_eowc_over_window.rs +++ b/src/frontend/src/optimizer/plan_node/stream_eowc_over_window.rs @@ -18,7 +18,7 @@ use fixedbitset::FixedBitSet; use risingwave_common::util::sort_util::OrderType; use risingwave_pb::stream_plan::stream_node::PbNodeBody; -use super::generic::{self, GenericPlanRef, PlanWindowFunction}; +use super::generic::{self, PlanWindowFunction}; use super::stream::prelude::*; use super::utils::{impl_distill_by_unit, TableCatalogBuilder}; use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, StreamNode}; diff --git a/src/frontend/src/optimizer/plan_node/stream_group_topn.rs b/src/frontend/src/optimizer/plan_node/stream_group_topn.rs index e48d23d14e04e..8500e24b0fd9f 100644 --- a/src/frontend/src/optimizer/plan_node/stream_group_topn.rs +++ b/src/frontend/src/optimizer/plan_node/stream_group_topn.rs @@ -16,9 +16,8 @@ use fixedbitset::FixedBitSet; use pretty_xmlish::XmlNode; use risingwave_pb::stream_plan::stream_node::PbNodeBody; -use super::generic::{DistillUnit, GenericPlanRef, TopNLimit}; +use super::generic::{DistillUnit, TopNLimit}; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{plan_node_name, watermark_pretty, Distill}; use super::{generic, ExprRewritable, PlanBase, PlanTreeNodeUnary, StreamNode}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; diff --git a/src/frontend/src/optimizer/plan_node/stream_hash_agg.rs b/src/frontend/src/optimizer/plan_node/stream_hash_agg.rs index d5d7bde249a17..eb69d5c259bb6 100644 --- a/src/frontend/src/optimizer/plan_node/stream_hash_agg.rs +++ b/src/frontend/src/optimizer/plan_node/stream_hash_agg.rs @@ -17,14 +17,13 @@ use itertools::Itertools; use pretty_xmlish::XmlNode; use risingwave_pb::stream_plan::stream_node::PbNodeBody; -use super::generic::{self, GenericPlanRef, PlanAggCall}; +use super::generic::{self, PlanAggCall}; use super::stream::prelude::*; use super::utils::{childless_record, plan_node_name, watermark_pretty, Distill}; use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, StreamNode}; use crate::error::{ErrorCode, Result}; use crate::expr::{ExprRewriter, ExprVisitor}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; -use crate::optimizer::plan_node::stream::StreamPlanRef; use crate::stream_fragmenter::BuildFragmentGraphState; use crate::utils::{ColIndexMapping, ColIndexMappingRewriteExt, IndexSet}; diff --git a/src/frontend/src/optimizer/plan_node/stream_hash_join.rs b/src/frontend/src/optimizer/plan_node/stream_hash_join.rs index d5e5e9838ac66..b803fccef7b07 100644 --- a/src/frontend/src/optimizer/plan_node/stream_hash_join.rs +++ b/src/frontend/src/optimizer/plan_node/stream_hash_join.rs @@ -20,9 +20,8 @@ use risingwave_pb::plan_common::JoinType; use risingwave_pb::stream_plan::stream_node::NodeBody; use risingwave_pb::stream_plan::{DeltaExpression, HashJoinNode, PbInequalityPair}; -use super::generic::{GenericPlanRef, Join}; +use super::generic::Join; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{childless_record, plan_node_name, watermark_pretty, Distill}; use super::{ generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeBinary, StreamDeltaJoin, StreamNode, diff --git a/src/frontend/src/optimizer/plan_node/stream_hop_window.rs b/src/frontend/src/optimizer/plan_node/stream_hop_window.rs index 9cb5800cc7220..0cdddf77ed0e5 100644 --- a/src/frontend/src/optimizer/plan_node/stream_hop_window.rs +++ b/src/frontend/src/optimizer/plan_node/stream_hop_window.rs @@ -17,9 +17,7 @@ use risingwave_common::util::column_index_mapping::ColIndexMapping; use risingwave_pb::stream_plan::stream_node::PbNodeBody; use risingwave_pb::stream_plan::HopWindowNode; -use super::generic::GenericPlanRef; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{childless_record, watermark_pretty, Distill}; use super::{generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, StreamNode}; use crate::expr::{Expr, ExprImpl, ExprRewriter, ExprVisitor}; diff --git a/src/frontend/src/optimizer/plan_node/stream_materialize.rs b/src/frontend/src/optimizer/plan_node/stream_materialize.rs index 821176a5af302..c0c947b69f71c 100644 --- a/src/frontend/src/optimizer/plan_node/stream_materialize.rs +++ b/src/frontend/src/optimizer/plan_node/stream_materialize.rs @@ -27,14 +27,12 @@ use risingwave_pb::stream_plan::stream_node::PbNodeBody; use super::derive::derive_columns; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{childless_record, Distill}; use super::{reorganize_elements_id, ExprRewritable, PlanRef, PlanTreeNodeUnary, StreamNode}; use crate::catalog::table_catalog::{TableCatalog, TableType, TableVersion}; use crate::error::Result; use crate::optimizer::plan_node::derive::derive_pk; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; -use crate::optimizer::plan_node::generic::GenericPlanRef; use crate::optimizer::plan_node::{PlanBase, PlanNodeMeta}; use crate::optimizer::property::{Cardinality, Distribution, Order, RequiredDist}; use crate::stream_fragmenter::BuildFragmentGraphState; diff --git a/src/frontend/src/optimizer/plan_node/stream_over_window.rs b/src/frontend/src/optimizer/plan_node/stream_over_window.rs index 7173e3a46e0cd..be6c63bcb50de 100644 --- a/src/frontend/src/optimizer/plan_node/stream_over_window.rs +++ b/src/frontend/src/optimizer/plan_node/stream_over_window.rs @@ -23,7 +23,6 @@ use super::stream::prelude::*; use super::utils::{impl_distill_by_unit, TableCatalogBuilder}; use super::{generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, StreamNode}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; -use crate::optimizer::plan_node::generic::GenericPlanRef; use crate::stream_fragmenter::BuildFragmentGraphState; use crate::TableCatalog; diff --git a/src/frontend/src/optimizer/plan_node/stream_project.rs b/src/frontend/src/optimizer/plan_node/stream_project.rs index 1b97835e9896f..c077af9241aa1 100644 --- a/src/frontend/src/optimizer/plan_node/stream_project.rs +++ b/src/frontend/src/optimizer/plan_node/stream_project.rs @@ -17,9 +17,7 @@ use pretty_xmlish::XmlNode; use risingwave_pb::stream_plan::stream_node::PbNodeBody; use risingwave_pb::stream_plan::ProjectNode; -use super::generic::GenericPlanRef; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{childless_record, watermark_pretty, Distill}; use super::{generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, StreamNode}; use crate::expr::{ diff --git a/src/frontend/src/optimizer/plan_node/stream_share.rs b/src/frontend/src/optimizer/plan_node/stream_share.rs index 395a32bc9be8a..5bf575f622bce 100644 --- a/src/frontend/src/optimizer/plan_node/stream_share.rs +++ b/src/frontend/src/optimizer/plan_node/stream_share.rs @@ -16,7 +16,6 @@ use pretty_xmlish::XmlNode; use risingwave_pb::stream_plan::stream_node::PbNodeBody; use risingwave_pb::stream_plan::PbStreamNode; -use super::generic::GenericPlanRef; use super::stream::prelude::*; use super::utils::Distill; use super::{generic, ExprRewritable, PlanRef, PlanTreeNodeUnary, StreamExchange, StreamNode}; diff --git a/src/frontend/src/optimizer/plan_node/stream_sink.rs b/src/frontend/src/optimizer/plan_node/stream_sink.rs index e0bd1eb225e07..9e48a81251c6e 100644 --- a/src/frontend/src/optimizer/plan_node/stream_sink.rs +++ b/src/frontend/src/optimizer/plan_node/stream_sink.rs @@ -37,12 +37,11 @@ use risingwave_pb::stream_plan::stream_node::PbNodeBody; use risingwave_pb::stream_plan::SinkLogStoreType; use super::derive::{derive_columns, derive_pk}; -use super::generic::{self, GenericPlanRef}; use super::stream::prelude::*; use super::utils::{ childless_record, infer_kv_log_store_table_catalog_inner, Distill, IndicesDisplay, }; -use super::{ExprRewritable, PlanBase, PlanRef, StreamNode, StreamProject}; +use super::{generic, ExprRewritable, PlanBase, PlanRef, StreamNode, StreamProject}; use crate::error::{ErrorCode, Result}; use crate::expr::{ExprImpl, FunctionCall, InputRef}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; diff --git a/src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs b/src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs index d5fce4eecdc1c..8ce0997b7fe1f 100644 --- a/src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs +++ b/src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs @@ -22,7 +22,6 @@ use super::utils::impl_distill_by_unit; use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, StreamNode}; use crate::expr::{ExprRewriter, ExprVisitor}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; -use crate::optimizer::plan_node::generic::PhysicalPlanRef; use crate::optimizer::property::RequiredDist; use crate::stream_fragmenter::BuildFragmentGraphState; diff --git a/src/frontend/src/optimizer/plan_node/stream_temporal_join.rs b/src/frontend/src/optimizer/plan_node/stream_temporal_join.rs index ecbdba1b32265..35b816c6e1bd0 100644 --- a/src/frontend/src/optimizer/plan_node/stream_temporal_join.rs +++ b/src/frontend/src/optimizer/plan_node/stream_temporal_join.rs @@ -19,9 +19,7 @@ use risingwave_pb::stream_plan::stream_node::NodeBody; use risingwave_pb::stream_plan::TemporalJoinNode; use risingwave_sqlparser::ast::AsOf; -use super::generic::GenericPlanRef; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{childless_record, watermark_pretty, Distill}; use super::{generic, ExprRewritable, PlanBase, PlanRef, PlanTreeNodeBinary}; use crate::expr::{Expr, ExprRewriter, ExprVisitor}; diff --git a/src/frontend/src/optimizer/plan_node/stream_union.rs b/src/frontend/src/optimizer/plan_node/stream_union.rs index 7a317a2677495..1c269ec0c5ad2 100644 --- a/src/frontend/src/optimizer/plan_node/stream_union.rs +++ b/src/frontend/src/optimizer/plan_node/stream_union.rs @@ -19,9 +19,7 @@ use pretty_xmlish::XmlNode; use risingwave_pb::stream_plan::stream_node::PbNodeBody; use risingwave_pb::stream_plan::UnionNode; -use super::generic::GenericPlanRef; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{childless_record, watermark_pretty, Distill}; use super::{generic, ExprRewritable, PlanRef}; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; diff --git a/src/frontend/src/optimizer/plan_node/stream_watermark_filter.rs b/src/frontend/src/optimizer/plan_node/stream_watermark_filter.rs index ed7e367f93715..ffb08776b3fe5 100644 --- a/src/frontend/src/optimizer/plan_node/stream_watermark_filter.rs +++ b/src/frontend/src/optimizer/plan_node/stream_watermark_filter.rs @@ -20,7 +20,6 @@ use risingwave_pb::catalog::WatermarkDesc; use risingwave_pb::stream_plan::stream_node::PbNodeBody; use super::stream::prelude::*; -use super::stream::StreamPlanRef; use super::utils::{childless_record, watermark_pretty, Distill, TableCatalogBuilder}; use super::{ExprRewritable, PlanBase, PlanRef, PlanTreeNodeUnary, StreamNode}; use crate::expr::{ExprDisplay, ExprImpl}; diff --git a/src/frontend/src/optimizer/plan_visitor/jsonb_stream_key_checker.rs b/src/frontend/src/optimizer/plan_visitor/jsonb_stream_key_checker.rs index d0a4358b4582a..c41e1c5b36463 100644 --- a/src/frontend/src/optimizer/plan_visitor/jsonb_stream_key_checker.rs +++ b/src/frontend/src/optimizer/plan_visitor/jsonb_stream_key_checker.rs @@ -17,7 +17,7 @@ use risingwave_common::types::DataType; use super::{DefaultBehavior, Merge}; use crate::optimizer::plan_node::generic::GenericPlanRef; -use crate::optimizer::plan_node::{PlanNode, *}; +use crate::optimizer::plan_node::*; use crate::optimizer::plan_visitor::PlanVisitor; #[derive(Debug, Clone, Default)] diff --git a/src/frontend/src/optimizer/property/distribution.rs b/src/frontend/src/optimizer/property/distribution.rs index 4999e1d8630bf..358ad934a9ccf 100644 --- a/src/frontend/src/optimizer/property/distribution.rs +++ b/src/frontend/src/optimizer/property/distribution.rs @@ -62,7 +62,6 @@ use crate::catalog::catalog_service::CatalogReader; use crate::catalog::FragmentId; use crate::error::Result; use crate::optimizer::property::Order; -use crate::optimizer::PlanRef; /// the distribution property provided by a operator. #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/src/frontend/src/optimizer/property/order.rs b/src/frontend/src/optimizer/property/order.rs index 1a657e190fac4..68f2120df567b 100644 --- a/src/frontend/src/optimizer/property/order.rs +++ b/src/frontend/src/optimizer/property/order.rs @@ -22,7 +22,6 @@ use risingwave_pb::common::PbColumnOrder; use super::super::plan_node::*; use crate::error::Result; -use crate::optimizer::PlanRef; // TODO(rc): use this type to replace all `Vec` #[derive(Debug, Clone, Default, PartialEq, Eq, Hash)] diff --git a/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs b/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs index 7823c7f41f7b4..c9cb4edc860cd 100644 --- a/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs +++ b/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs @@ -24,7 +24,6 @@ use crate::expr::{Expr, ExprImpl, ExprRewriter, ExprType, FunctionCall, InputRef use crate::optimizer::plan_expr_visitor::Strong; use crate::optimizer::plan_node::generic::{Agg, GenericPlanNode, GenericPlanRef}; use crate::optimizer::plan_visitor::{PlanCorrelatedIdFinder, PlanVisitor}; -use crate::optimizer::PlanRef; use crate::utils::{Condition, IndexSet}; /// Pull up correlated predicates from the right agg side of Apply to the `on` clause of Join. diff --git a/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_rule.rs b/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_rule.rs index b5df4f1738072..d6b59b9553911 100644 --- a/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_rule.rs +++ b/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_rule.rs @@ -20,7 +20,6 @@ use super::{BoxedRule, Rule}; use crate::expr::{CorrelatedId, CorrelatedInputRef, Expr, ExprImpl, ExprRewriter, InputRef}; use crate::optimizer::plan_node::generic::GenericPlanRef; use crate::optimizer::plan_visitor::{PlanCorrelatedIdFinder, PlanVisitor}; -use crate::optimizer::PlanRef; use crate::utils::Condition; /// This rule is for pattern: Apply->Project->Filter. diff --git a/src/frontend/src/scheduler/distributed/query.rs b/src/frontend/src/scheduler/distributed/query.rs index 004c16071ecf4..99826b4a4ab06 100644 --- a/src/frontend/src/scheduler/distributed/query.rs +++ b/src/frontend/src/scheduler/distributed/query.rs @@ -13,7 +13,6 @@ // limitations under the License. use std::collections::HashMap; -use std::default::Default; use std::fmt::{Debug, Formatter}; use std::mem; use std::sync::Arc; diff --git a/src/frontend/src/telemetry.rs b/src/frontend/src/telemetry.rs index 631914cee7a4f..2141b28109feb 100644 --- a/src/frontend/src/telemetry.rs +++ b/src/frontend/src/telemetry.rs @@ -97,7 +97,6 @@ mod tests { assert_eq!(report.base.node_type, TelemetryNodeType::Frontend); } - use risingwave_common::telemetry::pb_compatible::TelemetryToProtobuf; use risingwave_common::telemetry::{post_telemetry_report_pb, TELEMETRY_REPORT_URL}; // It is ok to diff --git a/src/frontend/src/utils/condition.rs b/src/frontend/src/utils/condition.rs index 5161877d1d163..d78adcbd07a97 100644 --- a/src/frontend/src/utils/condition.rs +++ b/src/frontend/src/utils/condition.rs @@ -1018,10 +1018,8 @@ mod cast_compare { #[cfg(test)] mod tests { use rand::Rng; - use risingwave_common::types::DataType; use super::*; - use crate::expr::{FunctionCall, InputRef}; #[test] fn test_split() { diff --git a/src/frontend/src/utils/with_options.rs b/src/frontend/src/utils/with_options.rs index 43091335be978..32306e6062800 100644 --- a/src/frontend/src/utils/with_options.rs +++ b/src/frontend/src/utils/with_options.rs @@ -13,7 +13,6 @@ // limitations under the License. use std::collections::{BTreeMap, HashMap}; -use std::convert::TryFrom; use std::num::NonZeroU32; use risingwave_connector::source::kafka::{ diff --git a/src/jni_core/src/jvm_runtime.rs b/src/jni_core/src/jvm_runtime.rs index c369ad7b38939..67808e368a8bf 100644 --- a/src/jni_core/src/jvm_runtime.rs +++ b/src/jni_core/src/jvm_runtime.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use core::option::Option::Some; use std::ffi::c_void; use std::path::PathBuf; use std::sync::OnceLock; diff --git a/src/meta/src/barrier/command.rs b/src/meta/src/barrier/command.rs index 36245fcf7518d..c97006aa9e945 100644 --- a/src/meta/src/barrier/command.rs +++ b/src/meta/src/barrier/command.rs @@ -13,7 +13,6 @@ // limitations under the License. use std::collections::{HashMap, HashSet}; -use std::default::Default; use std::sync::Arc; use futures::future::try_join_all; diff --git a/src/meta/src/controller/fragment.rs b/src/meta/src/controller/fragment.rs index 71142b8290897..74ec9c69fbf8a 100644 --- a/src/meta/src/controller/fragment.rs +++ b/src/meta/src/controller/fragment.rs @@ -1342,7 +1342,6 @@ impl CatalogController { #[cfg(test)] mod tests { use std::collections::{BTreeMap, HashMap}; - use std::default::Default; use itertools::Itertools; use risingwave_common::hash::{ParallelUnitId, ParallelUnitMapping}; diff --git a/src/meta/src/hummock/compaction/picker/base_level_compaction_picker.rs b/src/meta/src/hummock/compaction/picker/base_level_compaction_picker.rs index 6617b9496fe10..532fbeb9706e7 100644 --- a/src/meta/src/hummock/compaction/picker/base_level_compaction_picker.rs +++ b/src/meta/src/hummock/compaction/picker/base_level_compaction_picker.rs @@ -272,14 +272,11 @@ impl LevelCompactionPicker { #[cfg(test)] pub mod tests { - use itertools::Itertools; use super::*; use crate::hummock::compaction::compaction_config::CompactionConfigBuilder; use crate::hummock::compaction::selector::tests::*; - use crate::hummock::compaction::{ - CompactionDeveloperConfig, CompactionMode, TierCompactionPicker, - }; + use crate::hummock::compaction::{CompactionMode, TierCompactionPicker}; fn create_compaction_picker_for_test() -> LevelCompactionPicker { let config = Arc::new( diff --git a/src/meta/src/hummock/compaction/picker/manual_compaction_picker.rs b/src/meta/src/hummock/compaction/picker/manual_compaction_picker.rs index f46a99bc80c0d..82e58b87c5517 100644 --- a/src/meta/src/hummock/compaction/picker/manual_compaction_picker.rs +++ b/src/meta/src/hummock/compaction/picker/manual_compaction_picker.rs @@ -326,10 +326,10 @@ impl CompactionPicker for ManualCompactionPicker { #[cfg(test)] pub mod tests { - use std::collections::{HashMap, HashSet}; + use std::collections::HashMap; use risingwave_pb::hummock::compact_task; - pub use risingwave_pb::hummock::{KeyRange, Level, LevelType}; + pub use risingwave_pb::hummock::KeyRange; use super::*; use crate::hummock::compaction::compaction_config::CompactionConfigBuilder; diff --git a/src/meta/src/hummock/compaction/picker/min_overlap_compaction_picker.rs b/src/meta/src/hummock/compaction/picker/min_overlap_compaction_picker.rs index 01c3c050e574c..357fb7ee8a199 100644 --- a/src/meta/src/hummock/compaction/picker/min_overlap_compaction_picker.rs +++ b/src/meta/src/hummock/compaction/picker/min_overlap_compaction_picker.rs @@ -477,8 +477,6 @@ impl NonOverlapSubLevelPicker { pub mod tests { use std::collections::BTreeSet; - pub use risingwave_pb::hummock::{Level, LevelType}; - use super::*; use crate::hummock::compaction::overlap_strategy::RangeOverlapStrategy; use crate::hummock::compaction::selector::tests::{ diff --git a/src/meta/src/manager/catalog/mod.rs b/src/meta/src/manager/catalog/mod.rs index 6eae315bac72c..b556ef6ddd20a 100644 --- a/src/meta/src/manager/catalog/mod.rs +++ b/src/meta/src/manager/catalog/mod.rs @@ -19,7 +19,6 @@ mod utils; use std::collections::{BTreeMap, HashMap, HashSet, VecDeque}; use std::iter; -use std::option::Option::Some; use std::sync::Arc; use anyhow::{anyhow, Context}; diff --git a/src/meta/src/storage/etcd_meta_store.rs b/src/meta/src/storage/etcd_meta_store.rs index 8c5f93f9dd9ac..1986dab6247d6 100644 --- a/src/meta/src/storage/etcd_meta_store.rs +++ b/src/meta/src/storage/etcd_meta_store.rs @@ -14,7 +14,6 @@ use std::sync::atomic::{self, AtomicI64}; -use anyhow; use async_trait::async_trait; use etcd_client::{Compare, CompareOp, Error as EtcdError, GetOptions, Txn, TxnOp}; use futures::Future; diff --git a/src/meta/src/stream/stream_manager.rs b/src/meta/src/stream/stream_manager.rs index b2207e1b02faf..04b7c4640d38a 100644 --- a/src/meta/src/stream/stream_manager.rs +++ b/src/meta/src/stream/stream_manager.rs @@ -734,13 +734,12 @@ impl GlobalStreamManager { #[cfg(test)] mod tests { - use std::collections::{BTreeMap, HashMap, HashSet}; + use std::collections::BTreeMap; use std::net::SocketAddr; - use std::sync::{Arc, Mutex}; + use std::sync::Mutex; use std::time::Duration; use futures::{Stream, TryStreamExt}; - use risingwave_common::catalog::TableId; use risingwave_common::hash::ParallelUnitMapping; use risingwave_common::system_param::reader::SystemParamsRead; use risingwave_pb::common::{HostAddress, WorkerType}; @@ -753,10 +752,7 @@ mod tests { StreamService, StreamServiceServer, }; use risingwave_pb::stream_service::streaming_control_stream_response::InitResponse; - use risingwave_pb::stream_service::{ - BroadcastActorInfoTableResponse, BuildActorsResponse, DropActorsRequest, - DropActorsResponse, UpdateActorsResponse, *, - }; + use risingwave_pb::stream_service::*; use tokio::spawn; use tokio::sync::mpsc::unbounded_channel; use tokio::sync::oneshot::Sender; @@ -768,14 +764,14 @@ mod tests { use tonic::{Request, Response, Status, Streaming}; use super::*; - use crate::barrier::{GlobalBarrierManager, StreamRpcManager}; + use crate::barrier::GlobalBarrierManager; use crate::hummock::{CompactorManager, HummockManager}; use crate::manager::sink_coordination::SinkCoordinatorManager; use crate::manager::{ CatalogManager, CatalogManagerRef, ClusterManager, FragmentManager, FragmentManagerRef, - MetaSrvEnv, RelationIdEnum, StreamingClusterInfo, + RelationIdEnum, StreamingClusterInfo, }; - use crate::model::{ActorId, FragmentId}; + use crate::model::FragmentId; use crate::rpc::ddl_controller::DropMode; use crate::rpc::metrics::MetaMetrics; use crate::stream::{ScaleController, SourceManager}; diff --git a/src/object_store/src/object/error.rs b/src/object_store/src/object/error.rs index f13ae2b4d8f51..9b704295beb87 100644 --- a/src/object_store/src/object/error.rs +++ b/src/object_store/src/object/error.rs @@ -13,7 +13,6 @@ // limitations under the License. use std::io; -use std::marker::{Send, Sync}; use aws_sdk_s3::operation::get_object::GetObjectError; use aws_sdk_s3::operation::head_object::HeadObjectError; diff --git a/src/object_store/src/object/mem.rs b/src/object_store/src/object/mem.rs index 3a1a7ed655e81..b790a2cdecf5e 100644 --- a/src/object_store/src/object/mem.rs +++ b/src/object_store/src/object/mem.rs @@ -307,7 +307,6 @@ impl Stream for InMemObjectIter { #[cfg(test)] mod tests { - use bytes::Bytes; use futures::TryStreamExt; use itertools::enumerate; diff --git a/src/object_store/src/object/opendal_engine/opendal_object_store.rs b/src/object_store/src/object/opendal_engine/opendal_object_store.rs index d50422f015c7a..95733bc8f44cc 100644 --- a/src/object_store/src/object/opendal_engine/opendal_object_store.rs +++ b/src/object_store/src/object/opendal_engine/opendal_object_store.rs @@ -255,8 +255,6 @@ impl StreamingUploader for OpendalStreamingUploader { #[cfg(test)] mod tests { - use bytes::Bytes; - use super::*; async fn list_all(prefix: &str, store: &OpendalObjectStore) -> Vec { diff --git a/src/sqlparser/tests/sqlparser_common.rs b/src/sqlparser/tests/sqlparser_common.rs index ff0e9d2e53c40..ac6a1d310944a 100644 --- a/src/sqlparser/tests/sqlparser_common.rs +++ b/src/sqlparser/tests/sqlparser_common.rs @@ -25,7 +25,6 @@ use risingwave_sqlparser::ast::*; use risingwave_sqlparser::keywords::ALL_KEYWORDS; use risingwave_sqlparser::parser::ParserError; use risingwave_sqlparser::test_utils::*; -use test_utils::{expr_from_projection, join, number, only, table, table_alias}; #[test] fn parse_insert_values() { diff --git a/src/storage/hummock_sdk/src/key.rs b/src/storage/hummock_sdk/src/key.rs index 39dd26eae3ff0..f7c496a13c3c7 100644 --- a/src/storage/hummock_sdk/src/key.rs +++ b/src/storage/hummock_sdk/src/key.rs @@ -1100,8 +1100,6 @@ impl + Ord + Eq, const SKIP_DEDUP: bool> FullKeyTracker Date: Thu, 11 Apr 2024 23:00:32 +0800 Subject: [PATCH 13/39] chore: fix more fmt` Signed-off-by: MrCroxx --- src/storage/hummock_trace/src/write.rs | 2 +- src/storage/src/hummock/iterator/backward_user.rs | 1 - src/storage/src/hummock/iterator/forward_user.rs | 1 - src/storage/src/hummock/iterator/test_utils.rs | 1 - src/storage/src/hummock/shared_buffer/shared_buffer_batch.rs | 2 +- src/storage/src/hummock/sstable/block.rs | 5 ++--- src/storage/src/hummock/sstable/block_iterator.rs | 3 +-- src/storage/src/hummock/sstable/builder.rs | 4 +--- src/storage/src/hummock/sstable/multi_builder.rs | 3 +-- src/storage/src/hummock/sstable/xor_filter.rs | 2 +- src/storage/src/hummock/store/hummock_storage.rs | 1 - src/storage/src/lib.rs | 1 - src/storage/src/memory.rs | 1 - src/storage/src/row_serde/value_serde.rs | 1 - src/storage/src/store_impl.rs | 2 -- src/storage/src/table/batch_table/storage_table.rs | 1 - src/utils/pgwire/src/pg_message.rs | 2 +- 17 files changed, 9 insertions(+), 24 deletions(-) diff --git a/src/storage/hummock_trace/src/write.rs b/src/storage/hummock_trace/src/write.rs index 528cdac5f659d..5cf10b39378f2 100644 --- a/src/storage/hummock_trace/src/write.rs +++ b/src/storage/hummock_trace/src/write.rs @@ -103,7 +103,7 @@ impl> Drop for TraceWriterImpl { mod test { use std::io::Cursor; - use bincode::{config, decode_from_slice, encode_to_vec}; + use bincode::{decode_from_slice, encode_to_vec}; use byteorder::{BigEndian, ReadBytesExt}; use bytes::Bytes; diff --git a/src/storage/src/hummock/iterator/backward_user.rs b/src/storage/src/hummock/iterator/backward_user.rs index 39e6f7eafa256..50826c390be6c 100644 --- a/src/storage/src/hummock/iterator/backward_user.rs +++ b/src/storage/src/hummock/iterator/backward_user.rs @@ -313,7 +313,6 @@ mod tests { }; use crate::hummock::iterator::MergeIterator; use crate::hummock::test_utils::gen_test_sstable; - use crate::hummock::value::HummockValue; use crate::hummock::{BackwardSstableIterator, SstableStoreRef, TableHolder}; #[tokio::test] diff --git a/src/storage/src/hummock/iterator/forward_user.rs b/src/storage/src/hummock/iterator/forward_user.rs index 8a68c10d0b515..759200f8378c5 100644 --- a/src/storage/src/hummock/iterator/forward_user.rs +++ b/src/storage/src/hummock/iterator/forward_user.rs @@ -274,7 +274,6 @@ mod tests { SstableIterator, SstableIteratorReadOptions, SstableIteratorType, }; use crate::hummock::sstable_store::SstableStoreRef; - use crate::hummock::value::HummockValue; use crate::hummock::TableHolder; #[tokio::test] diff --git a/src/storage/src/hummock/iterator/test_utils.rs b/src/storage/src/hummock/iterator/test_utils.rs index 0103280570f5e..ca9b8367b0714 100644 --- a/src/storage/src/hummock/iterator/test_utils.rs +++ b/src/storage/src/hummock/iterator/test_utils.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::iter::Iterator; use std::sync::Arc; use bytes::Bytes; diff --git a/src/storage/src/hummock/shared_buffer/shared_buffer_batch.rs b/src/storage/src/hummock/shared_buffer/shared_buffer_batch.rs index 5857c5d2f8bd2..9ef8e6ae3a779 100644 --- a/src/storage/src/hummock/shared_buffer/shared_buffer_batch.rs +++ b/src/storage/src/hummock/shared_buffer/shared_buffer_batch.rs @@ -779,7 +779,7 @@ impl DeleteRangeIterator for SharedBufferDeleteRangeIterator { #[cfg(test)] mod tests { - use std::ops::Bound::{Excluded, Included}; + use std::ops::Bound::Excluded; use risingwave_common::util::epoch::{test_epoch, EpochExt}; use risingwave_hummock_sdk::key::map_table_key_range; diff --git a/src/storage/src/hummock/sstable/block.rs b/src/storage/src/hummock/sstable/block.rs index 1028348a7d349..2fd20b41607bc 100644 --- a/src/storage/src/hummock/sstable/block.rs +++ b/src/storage/src/hummock/sstable/block.rs @@ -22,7 +22,6 @@ use bytes::{Buf, BufMut, Bytes, BytesMut}; use risingwave_common::catalog::TableId; use risingwave_hummock_sdk::key::FullKey; use risingwave_hummock_sdk::KeyComparator; -use {lz4, zstd}; use super::utils::{bytes_diff_below_max_key_length, xxhash64_verify, CompressionAlgorithm}; use crate::hummock::sstable::utils; @@ -793,9 +792,9 @@ impl BlockBuilder { #[cfg(test)] mod tests { - use risingwave_common::catalog::TableId; + use risingwave_common::util::epoch::test_epoch; - use risingwave_hummock_sdk::key::{FullKey, MAX_KEY_LEN}; + use risingwave_hummock_sdk::key::MAX_KEY_LEN; use super::*; use crate::hummock::{BlockHolder, BlockIterator}; diff --git a/src/storage/src/hummock/sstable/block_iterator.rs b/src/storage/src/hummock/sstable/block_iterator.rs index 7344d033ddde4..daf25024846c4 100644 --- a/src/storage/src/hummock/sstable/block_iterator.rs +++ b/src/storage/src/hummock/sstable/block_iterator.rs @@ -330,11 +330,10 @@ impl BlockIterator { #[cfg(test)] mod tests { - use risingwave_common::catalog::TableId; use risingwave_common::util::epoch::test_epoch; use super::*; - use crate::hummock::{Block, BlockBuilder, BlockBuilderOptions}; + use crate::hummock::{BlockBuilder, BlockBuilderOptions}; fn build_iterator_for_test() -> BlockIterator { let options = BlockBuilderOptions::default(); diff --git a/src/storage/src/hummock/sstable/builder.rs b/src/storage/src/hummock/sstable/builder.rs index f3f6c2345c70c..11c95ef424dfa 100644 --- a/src/storage/src/hummock/sstable/builder.rs +++ b/src/storage/src/hummock/sstable/builder.rs @@ -626,9 +626,7 @@ pub(super) mod tests { default_builder_opt_for_test, gen_test_sstable_impl, mock_sst_writer, test_key_of, test_value_of, TEST_KEYS_COUNT, }; - use crate::hummock::{ - CachePolicy, Sstable, SstableWriterOptions, Xor16FilterBuilder, Xor8FilterBuilder, - }; + use crate::hummock::{CachePolicy, Sstable, SstableWriterOptions, Xor8FilterBuilder}; use crate::monitor::StoreLocalStatistic; #[tokio::test] diff --git a/src/storage/src/hummock/sstable/multi_builder.rs b/src/storage/src/hummock/sstable/multi_builder.rs index 4049811f78c9e..e40bfbad84d8d 100644 --- a/src/storage/src/hummock/sstable/multi_builder.rs +++ b/src/storage/src/hummock/sstable/multi_builder.rs @@ -370,13 +370,12 @@ impl TableBuilderFactory for LocalTableBuilderFactory { #[cfg(test)] mod tests { use risingwave_common::catalog::TableId; - use risingwave_common::hash::VirtualNode; use risingwave_common::util::epoch::{test_epoch, EpochExt}; use super::*; use crate::hummock::iterator::test_utils::mock_sstable_store; use crate::hummock::test_utils::{default_builder_opt_for_test, test_key_of, test_user_key_of}; - use crate::hummock::{SstableBuilderOptions, DEFAULT_RESTART_INTERVAL}; + use crate::hummock::DEFAULT_RESTART_INTERVAL; #[tokio::test] async fn test_empty() { diff --git a/src/storage/src/hummock/sstable/xor_filter.rs b/src/storage/src/hummock/sstable/xor_filter.rs index e096676008f89..6c20864c60ce4 100644 --- a/src/storage/src/hummock/sstable/xor_filter.rs +++ b/src/storage/src/hummock/sstable/xor_filter.rs @@ -453,7 +453,7 @@ mod tests { use crate::hummock::sstable::{SstableBuilder, SstableBuilderOptions}; use crate::hummock::test_utils::{test_user_key_of, test_value_of, TEST_KEYS_COUNT}; use crate::hummock::value::HummockValue; - use crate::hummock::{BlockIterator, CachePolicy, Sstable, SstableWriterOptions}; + use crate::hummock::{BlockIterator, CachePolicy, SstableWriterOptions}; use crate::monitor::StoreLocalStatistic; #[tokio::test] diff --git a/src/storage/src/hummock/store/hummock_storage.rs b/src/storage/src/hummock/store/hummock_storage.rs index fd392a3e023c7..fdd82f998f031 100644 --- a/src/storage/src/hummock/store/hummock_storage.rs +++ b/src/storage/src/hummock/store/hummock_storage.rs @@ -59,7 +59,6 @@ use crate::mem_table::ImmutableMemtable; use crate::monitor::{CompactorMetrics, HummockStateStoreMetrics, StoreLocalStatistic}; use crate::opts::StorageOpts; use crate::store::*; -use crate::StateStore; struct HummockStorageShutdownGuard { shutdown_sender: HummockEventSender, diff --git a/src/storage/src/lib.rs b/src/storage/src/lib.rs index e5b6e18ca3d98..21c0c7f49ae4c 100644 --- a/src/storage/src/lib.rs +++ b/src/storage/src/lib.rs @@ -36,7 +36,6 @@ #![recursion_limit = "256"] #![feature(error_generic_member_access)] #![feature(let_chains)] -#![feature(associated_type_bounds)] #![feature(exclusive_range_pattern)] #![feature(impl_trait_in_assoc_type)] #![feature(maybe_uninit_uninit_array)] diff --git a/src/storage/src/memory.rs b/src/storage/src/memory.rs index db8eafcf4bc1d..5d23c996f281f 100644 --- a/src/storage/src/memory.rs +++ b/src/storage/src/memory.rs @@ -350,7 +350,6 @@ mod batched_iter { #[cfg(test)] mod tests { use rand::Rng; - use risingwave_hummock_sdk::key::FullKey; use super::*; use crate::memory::sled::SledRangeKv; diff --git a/src/storage/src/row_serde/value_serde.rs b/src/storage/src/row_serde/value_serde.rs index bde7091597605..c4d4ef8b808f7 100644 --- a/src/storage/src/row_serde/value_serde.rs +++ b/src/storage/src/row_serde/value_serde.rs @@ -145,7 +145,6 @@ mod tests { use std::collections::HashSet; use risingwave_common::catalog::ColumnId; - use risingwave_common::row::OwnedRow; use risingwave_common::types::ScalarImpl::*; use risingwave_common::util::value_encoding::column_aware_row_encoding; use risingwave_common::util::value_encoding::column_aware_row_encoding::try_drop_invalid_columns; diff --git a/src/storage/src/store_impl.rs b/src/storage/src/store_impl.rs index 1d67e2fa9da2f..3abe3d4415a4d 100644 --- a/src/storage/src/store_impl.rs +++ b/src/storage/src/store_impl.rs @@ -220,7 +220,6 @@ pub mod verify { use crate::storage_value::StorageValue; use crate::store::*; use crate::store_impl::AsHummock; - use crate::StateStore; fn assert_result_eq( first: &std::result::Result, @@ -739,7 +738,6 @@ pub mod boxed_state_store { use crate::hummock::HummockStorage; use crate::store::*; use crate::store_impl::AsHummock; - use crate::StateStore; #[async_trait::async_trait] pub trait DynamicDispatchedStateStoreIter: Send { diff --git a/src/storage/src/table/batch_table/storage_table.rs b/src/storage/src/table/batch_table/storage_table.rs index 3cf02d31ce87c..f3a6205db90ea 100644 --- a/src/storage/src/table/batch_table/storage_table.rs +++ b/src/storage/src/table/batch_table/storage_table.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::default::Default; use std::ops::Bound::{self, Excluded, Included, Unbounded}; use std::ops::{Index, RangeBounds}; use std::sync::Arc; diff --git a/src/utils/pgwire/src/pg_message.rs b/src/utils/pgwire/src/pg_message.rs index 4898faf89b5d9..00c9a09b2eda6 100644 --- a/src/utils/pgwire/src/pg_message.rs +++ b/src/utils/pgwire/src/pg_message.rs @@ -697,7 +697,7 @@ macro_rules! from_usize { impl FromUsize for $t { #[inline] fn from_usize(x: usize) -> Result<$t> { - if x > <$t>::max_value() as usize { + if x > <$t>::MAX as usize { Err(Error::new(ErrorKind::InvalidInput, "value too large to transmit").into()) } else { Ok(x as $t) From b45050248dc6d811734f70b94c0ffe5c4c22eb8c Mon Sep 17 00:00:00 2001 From: MrCroxx Date: Thu, 11 Apr 2024 23:14:21 +0800 Subject: [PATCH 14/39] chore: i mean, more Signed-off-by: MrCroxx --- src/connector/src/sink/remote.rs | 2 +- .../filesystem/opendal_source/opendal_enumerator.rs | 5 +---- src/storage/hummock_sdk/src/table_watermark.rs | 9 +++++---- src/storage/src/hummock/compactor/compactor_runner.rs | 4 +++- src/storage/src/hummock/event_handler/refiller.rs | 4 +--- src/stream/src/common/table/state_table.rs | 1 - 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/connector/src/sink/remote.rs b/src/connector/src/sink/remote.rs index 4d3c48b6ec5c7..eac2c4d5c0fd8 100644 --- a/src/connector/src/sink/remote.rs +++ b/src/connector/src/sink/remote.rs @@ -167,7 +167,7 @@ impl Sink for RemoteSink { async fn validate_remote_sink(param: &SinkParam, sink_name: &str) -> ConnectorResult<()> { if sink_name == ElasticSearchSink::SINK_NAME && param.downstream_pk.len() > 1 - && param.properties.get(ES_OPTION_DELIMITER).is_none() + && !param.properties.contains_key(ES_OPTION_DELIMITER) { bail!("Es sink only support single pk or pk with delimiter option"); } diff --git a/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs b/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs index 96646ade0e1df..8ff1eeadccd94 100644 --- a/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs +++ b/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs @@ -56,10 +56,7 @@ impl SplitEnumerator for OpendalEnumerator { impl OpendalEnumerator { pub async fn list(&self) -> ConnectorResult { - let prefix = match &self.prefix { - Some(prefix) => prefix, - None => "", - }; + let prefix = self.prefix.as_ref().unwrap_or_default(); let object_lister = self .op diff --git a/src/storage/hummock_sdk/src/table_watermark.rs b/src/storage/hummock_sdk/src/table_watermark.rs index dad434bc8805b..24d28dec9ba1c 100644 --- a/src/storage/hummock_sdk/src/table_watermark.rs +++ b/src/storage/hummock_sdk/src/table_watermark.rs @@ -14,6 +14,7 @@ use std::collections::hash_map::Entry; use std::collections::{BTreeMap, HashMap, HashSet, VecDeque}; +use std::fmt::Display; use std::mem::size_of; use std::ops::Bound::{Excluded, Included, Unbounded}; use std::sync::Arc; @@ -258,11 +259,11 @@ pub enum WatermarkDirection { Descending, } -impl ToString for WatermarkDirection { - fn to_string(&self) -> String { +impl Display for WatermarkDirection { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - WatermarkDirection::Ascending => "Ascending".to_string(), - WatermarkDirection::Descending => "Descending".to_string(), + WatermarkDirection::Ascending => write!(f, "Ascending"), + WatermarkDirection::Descending => write!(f, "Descending"), } } } diff --git a/src/storage/src/hummock/compactor/compactor_runner.rs b/src/storage/src/hummock/compactor/compactor_runner.rs index 46ccaf0ebb94d..379e4325163c1 100644 --- a/src/storage/src/hummock/compactor/compactor_runner.rs +++ b/src/storage/src/hummock/compactor/compactor_runner.rs @@ -276,7 +276,9 @@ pub fn partition_overlapping_sstable_infos( &prev_group.max_right_bound, &sst.key_range.as_ref().unwrap().left, ) { - prev_group.max_right_bound = sst.key_range.as_ref().unwrap().right.clone(); + prev_group + .max_right_bound + .clone_from(&sst.key_range.as_ref().unwrap().right); prev_group.ssts.push(sst); continue; } diff --git a/src/storage/src/hummock/event_handler/refiller.rs b/src/storage/src/hummock/event_handler/refiller.rs index 1c592fac85a2d..318db82b57aca 100644 --- a/src/storage/src/hummock/event_handler/refiller.rs +++ b/src/storage/src/hummock/event_handler/refiller.rs @@ -295,9 +295,7 @@ impl CacheRefiller { /// Clear the queue for cache refill and return an event that merges all pending cache refill events /// into a single event that takes the earliest and latest version. pub(crate) fn clear(&mut self) -> Option { - let Some(last_item) = self.queue.pop_back() else { - return None; - }; + let last_item = self.queue.pop_back()?; let mut event = last_item.event; while let Some(item) = self.queue.pop_back() { assert_eq!( diff --git a/src/stream/src/common/table/state_table.rs b/src/stream/src/common/table/state_table.rs index d05cd891565e6..c39458a18c4ff 100644 --- a/src/stream/src/common/table/state_table.rs +++ b/src/stream/src/common/table/state_table.rs @@ -13,7 +13,6 @@ // limitations under the License. use std::collections::HashMap; -use std::default::Default; use std::ops::Bound; use std::ops::Bound::*; use std::sync::Arc; From 0372b40c701a7a907637be040056a3bab02a32c8 Mon Sep 17 00:00:00 2001 From: MrCroxx Date: Thu, 11 Apr 2024 23:26:40 +0800 Subject: [PATCH 15/39] chore: fix more Signed-off-by: MrCroxx --- .../source/filesystem/opendal_source/opendal_enumerator.rs | 5 ++++- src/utils/pgwire/src/pg_protocol.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs b/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs index 8ff1eeadccd94..96646ade0e1df 100644 --- a/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs +++ b/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs @@ -56,7 +56,10 @@ impl SplitEnumerator for OpendalEnumerator { impl OpendalEnumerator { pub async fn list(&self) -> ConnectorResult { - let prefix = self.prefix.as_ref().unwrap_or_default(); + let prefix = match &self.prefix { + Some(prefix) => prefix, + None => "", + }; let object_lister = self .op diff --git a/src/utils/pgwire/src/pg_protocol.rs b/src/utils/pgwire/src/pg_protocol.rs index 38eba6e92d5b6..5e9e7a056f261 100644 --- a/src/utils/pgwire/src/pg_protocol.rs +++ b/src/utils/pgwire/src/pg_protocol.rs @@ -767,7 +767,7 @@ where self.unnamed_portal.replace(portal); } else { assert!( - self.result_cache.get(&portal_name).is_none(), + !self.result_cache.contains_key(&portal_name), "Named portal never can be overridden." ); self.portal_store.insert(portal_name.clone(), portal); From 2d86e896736ad7ab7a4bbf4c6454b59ab6763fea Mon Sep 17 00:00:00 2001 From: MrCroxx Date: Fri, 12 Apr 2024 11:30:01 +0800 Subject: [PATCH 16/39] chore: bump toolchain to nightly-2024-04-12 Signed-off-by: MrCroxx --- ci/rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/rust-toolchain b/ci/rust-toolchain index 814358b97d566..4d85754edc976 100644 --- a/ci/rust-toolchain +++ b/ci/rust-toolchain @@ -4,4 +4,4 @@ # 3. (optional) **follow the instructions in lints/README.md** to update the toolchain and dependencies for lints [toolchain] -channel = "nightly-2024-04-11" +channel = "nightly-2024-04-12" From 819cbcab082c7c89b644b252400af6d58e99f192 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Tue, 16 Apr 2024 12:20:36 +0800 Subject: [PATCH 17/39] remove stable feature `associated_type_bounds` Signed-off-by: Richard Chien --- src/stream/spill_test/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/stream/spill_test/src/lib.rs b/src/stream/spill_test/src/lib.rs index 277bb458a4fcc..deadc48ea9a33 100644 --- a/src/stream/spill_test/src/lib.rs +++ b/src/stream/spill_test/src/lib.rs @@ -14,7 +14,6 @@ #![feature(proc_macro_hygiene, stmt_expr_attributes)] #![feature(custom_test_frameworks)] #![feature(type_alias_impl_trait)] -#![feature(associated_type_bounds)] #[cfg(test)] mod test_mem_table; From a897e54738cc3857b1519a655a678bf8767277b2 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Tue, 16 Apr 2024 13:54:25 +0800 Subject: [PATCH 18/39] fix btree cursor use in over_partition Signed-off-by: Richard Chien --- .../executor/over_window/over_partition.rs | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/stream/src/executor/over_window/over_partition.rs b/src/stream/src/executor/over_window/over_partition.rs index e6d095e91e5c0..baac154593f7a 100644 --- a/src/stream/src/executor/over_window/over_partition.rs +++ b/src/stream/src/executor/over_window/over_partition.rs @@ -32,6 +32,7 @@ use risingwave_expr::window_function::{ }; use risingwave_storage::store::PrefetchOptions; use risingwave_storage::StateStore; +use static_assertions::const_assert; use super::general::RowConverter; use crate::common::table::state_table::StateTable; @@ -88,9 +89,11 @@ pub(super) fn shrink_partition_cache( let (sk_start, sk_end) = recently_accessed_range.into_inner(); let (ck_start, ck_end) = (CacheKey::from(sk_start), CacheKey::from(sk_end)); + // find the cursor just before `ck_start` let mut cursor = range_cache.inner().upper_bound(Bound::Excluded(&ck_start)); for _ in 0..MAGIC_JITTER_PREVENTION { if cursor.prev().is_none() { + // already at the beginning break; } } @@ -100,9 +103,11 @@ pub(super) fn shrink_partition_cache( .unwrap_or_else(|| range_cache.first_key_value().unwrap().0) .clone(); - let mut cursor = range_cache.inner().lower_bound(Bound::Included(&ck_start)); + // find the cursor just after `ck_end` + let mut cursor = range_cache.inner().lower_bound(Bound::Excluded(&ck_end)); for _ in 0..MAGIC_JITTER_PREVENTION { if cursor.next().is_none() { + // already at the end break; } } @@ -122,12 +127,18 @@ pub(super) fn shrink_partition_cache( let (sk_start, _sk_end) = recently_accessed_range.into_inner(); let ck_start = CacheKey::from(sk_start); - let mut capacity_remain = MAGIC_CACHE_SIZE; // precision is not important here, code simplicity is first + let mut capacity_remain = MAGIC_CACHE_SIZE; // precision is not important here, code simplicity is the first + const_assert!(MAGIC_JITTER_PREVENTION < MAGIC_CACHE_SIZE); - let mut cursor = range_cache.inner().upper_bound(Bound::Excluded(&ck_start)); + // find the cursor just before `ck_start` + let cursor_just_before_ck_start = + range_cache.inner().upper_bound(Bound::Excluded(&ck_start)); + + let mut cursor = cursor_just_before_ck_start.clone(); // go back for at most `MAGIC_JITTER_PREVENTION` entries for _ in 0..MAGIC_JITTER_PREVENTION { if cursor.prev().is_none() { + // already at the beginning break; } capacity_remain -= 1; @@ -138,10 +149,11 @@ pub(super) fn shrink_partition_cache( .unwrap_or_else(|| range_cache.first_key_value().unwrap().0) .clone(); - let mut cursor = range_cache.inner().lower_bound(Bound::Included(&ck_start)); + let mut cursor = cursor_just_before_ck_start; // go forward for at most `capacity_remain` entries for _ in 0..capacity_remain { if cursor.next().is_none() { + // already at the end break; } } @@ -162,12 +174,18 @@ pub(super) fn shrink_partition_cache( let (_sk_start, sk_end) = recently_accessed_range.into_inner(); let ck_end = CacheKey::from(sk_end); - let mut capacity_remain = MAGIC_CACHE_SIZE; // precision is not important here, code simplicity is first + let mut capacity_remain = MAGIC_CACHE_SIZE; // precision is not important here, code simplicity is the first + const_assert!(MAGIC_JITTER_PREVENTION < MAGIC_CACHE_SIZE); + + // find the cursor just after `ck_end` + let cursor_just_after_ck_end = + range_cache.inner().lower_bound(Bound::Excluded(&ck_end)); - let mut cursor = range_cache.inner().lower_bound(Bound::Excluded(&ck_end)); + let mut cursor = cursor_just_after_ck_end.clone(); // go forward for at most `MAGIC_JITTER_PREVENTION` entries for _ in 0..MAGIC_JITTER_PREVENTION { if cursor.next().is_none() { + // already at the end break; } capacity_remain -= 1; @@ -178,10 +196,11 @@ pub(super) fn shrink_partition_cache( .unwrap_or_else(|| range_cache.last_key_value().unwrap().0) .clone(); - let mut cursor = range_cache.inner().upper_bound(Bound::Included(&ck_end)); + let mut cursor = cursor_just_after_ck_end; // go back for at most `capacity_remain` entries for _ in 0..capacity_remain { if cursor.prev().is_none() { + // already at the beginning break; } } From ef6eb2116e1a6981084f069668e41b090c0c6d0b Mon Sep 17 00:00:00 2001 From: xxchan Date: Thu, 18 Apr 2024 14:12:07 +0000 Subject: [PATCH 19/39] fix lints Signed-off-by: xxchan --- Cargo.toml | 2 ++ src/batch/src/executor/join/hash_join.rs | 2 +- src/compute/src/telemetry.rs | 1 + src/connector/src/sink/encoder/avro.rs | 2 +- src/connector/src/sink/encoder/json.rs | 4 ++-- .../filesystem/opendal_source/opendal_enumerator.rs | 5 +---- src/frontend/src/binder/bind_context.rs | 1 + src/frontend/src/binder/relation/join.rs | 4 ++-- .../catalog/system_catalog/rw_catalog/rw_iceberg_files.rs | 2 +- src/frontend/src/handler/create_sink.rs | 2 +- src/frontend/src/handler/create_source.rs | 2 +- src/frontend/src/handler/create_table.rs | 2 +- src/frontend/src/optimizer/plan_node/generic/project.rs | 2 +- src/frontend/src/scheduler/distributed/stage.rs | 1 + src/frontend/src/telemetry.rs | 1 + src/meta/src/barrier/command.rs | 4 ++-- src/meta/src/barrier/mod.rs | 1 + src/meta/src/hummock/compaction/picker/mod.rs | 2 ++ .../compaction/picker/space_reclaim_compaction_picker.rs | 4 ++-- src/meta/src/hummock/manager/compaction.rs | 2 +- src/meta/src/hummock/manager/mod.rs | 7 ++++--- src/meta/src/manager/catalog/mod.rs | 2 +- src/meta/src/manager/metadata.rs | 1 + src/sqlparser/tests/test_utils/mod.rs | 1 + src/storage/compactor/src/lib.rs | 2 ++ src/storage/compactor/src/telemetry.rs | 1 + src/stream/src/common/compact_chunk.rs | 2 +- .../src/executor/backfill/cdc/upstream_table/snapshot.rs | 8 ++++---- src/stream/src/executor/mview/materialize.rs | 8 ++++---- .../src/executor/source/source_backfill_executor.rs | 6 +++--- src/stream/src/executor/source/source_executor.rs | 4 ++-- src/tests/compaction_test/src/lib.rs | 2 +- 32 files changed, 51 insertions(+), 39 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f3ccf32075761..cc4223a88bbf2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -253,6 +253,8 @@ ptr_arg = "allow" get_first = "allow" # https://github.com/rust-lang/rust-clippy/issues/12016 blocks_in_conditions = "allow" +# https://github.com/rust-lang/rust-clippy/issues/12537 +duplicated_attributes = "allow" [workspace.lints.rustdoc] private_intra_doc_links = "allow" diff --git a/src/batch/src/executor/join/hash_join.rs b/src/batch/src/executor/join/hash_join.rs index c9bc0caad7cef..d606522a33357 100644 --- a/src/batch/src/executor/join/hash_join.rs +++ b/src/batch/src/executor/join/hash_join.rs @@ -580,7 +580,7 @@ impl HashJoinExecutor { } shutdown_rx.check()?; if !ANTI_JOIN { - if hash_map.get(probe_key).is_some() { + if hash_map.contains_key(probe_key) { if let Some(spilled) = Self::append_one_probe_row( &mut chunk_builder, &probe_chunk, diff --git a/src/compute/src/telemetry.rs b/src/compute/src/telemetry.rs index 143ec51c5bc39..b1165175ca6bf 100644 --- a/src/compute/src/telemetry.rs +++ b/src/compute/src/telemetry.rs @@ -33,6 +33,7 @@ impl ComputeTelemetryCreator { #[async_trait::async_trait] impl TelemetryReportCreator for ComputeTelemetryCreator { + #[expect(refining_impl_trait)] async fn create_report( &self, tracking_id: String, diff --git a/src/connector/src/sink/encoder/avro.rs b/src/connector/src/sink/encoder/avro.rs index 924beb281eda7..20d8a0997a7ff 100644 --- a/src/connector/src/sink/encoder/avro.rs +++ b/src/connector/src/sink/encoder/avro.rs @@ -526,7 +526,7 @@ mod tests { test_ok( &DataType::Int64, - Some(ScalarImpl::Int64(std::i64::MAX)), + Some(ScalarImpl::Int64(i64::MAX)), r#""long""#, Value::Long(i64::MAX), ); diff --git a/src/connector/src/sink/encoder/json.rs b/src/connector/src/sink/encoder/json.rs index 1064924e60120..1a0069e816288 100644 --- a/src/connector/src/sink/encoder/json.rs +++ b/src/connector/src/sink/encoder/json.rs @@ -508,7 +508,7 @@ mod tests { data_type: DataType::Int64, ..mock_field.clone() }, - Some(ScalarImpl::Int64(std::i64::MAX).as_scalar_ref_impl()), + Some(ScalarImpl::Int64(i64::MAX).as_scalar_ref_impl()), DateHandlingMode::FromCe, TimestampHandlingMode::String, TimestamptzHandlingMode::UtcString, @@ -518,7 +518,7 @@ mod tests { .unwrap(); assert_eq!( serde_json::to_string(&int64_value).unwrap(), - std::i64::MAX.to_string() + i64::MAX.to_string() ); // https://github.com/debezium/debezium/blob/main/debezium-core/src/main/java/io/debezium/time/ZonedTimestamp.java diff --git a/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs b/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs index 96646ade0e1df..f65eacd9a9696 100644 --- a/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs +++ b/src/connector/src/source/filesystem/opendal_source/opendal_enumerator.rs @@ -56,10 +56,7 @@ impl SplitEnumerator for OpendalEnumerator { impl OpendalEnumerator { pub async fn list(&self) -> ConnectorResult { - let prefix = match &self.prefix { - Some(prefix) => prefix, - None => "", - }; + let prefix = self.prefix.as_deref().unwrap_or(""); let object_lister = self .op diff --git a/src/frontend/src/binder/bind_context.rs b/src/frontend/src/binder/bind_context.rs index 21a987cbfac01..c0336ddfb3e85 100644 --- a/src/frontend/src/binder/bind_context.rs +++ b/src/frontend/src/binder/bind_context.rs @@ -107,6 +107,7 @@ pub enum BindingCteState { pub struct RecursiveUnion { /// currently this *must* be true, /// otherwise binding will fail. + #[expect(dead_code)] pub all: bool, /// lhs part of the `UNION ALL` operator pub base: Box, diff --git a/src/frontend/src/binder/relation/join.rs b/src/frontend/src/binder/relation/join.rs index c2f820aff7744..d13b683be08b0 100644 --- a/src/frontend/src/binder/relation/join.rs +++ b/src/frontend/src/binder/relation/join.rs @@ -164,10 +164,10 @@ impl Binder { JoinConstraint::Using(cols) => { // sanity check for col in &cols { - if old_context.indices_of.get(&col.real_value()).is_none() { + if !old_context.indices_of.contains_key(&col.real_value()) { return Err(ErrorCode::ItemNotFound(format!("column \"{}\" specified in USING clause does not exist in left table", col.real_value())).into()); } - if self.context.indices_of.get(&col.real_value()).is_none() { + if !self.context.indices_of.contains_key(&col.real_value()) { return Err(ErrorCode::ItemNotFound(format!("column \"{}\" specified in USING clause does not exist in right table", col.real_value())).into()); } } diff --git a/src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs b/src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs index 7afe2561e1775..73c88b58ba5f7 100644 --- a/src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs +++ b/src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs @@ -44,7 +44,7 @@ struct RwIcebergFiles { /// Total file size in bytes pub file_size_in_bytes: i64, /// Field ids used to determine row equality in equality delete files. - /// Required when content is EqualityDeletes and should be null + /// Required when content is `EqualityDeletes` and should be null /// otherwise. Fields with ids listed in this column must be present /// in the delete file pub equality_ids: Option>, diff --git a/src/frontend/src/handler/create_sink.rs b/src/frontend/src/handler/create_sink.rs index 1cba0e21fc245..fde41cc1f1812 100644 --- a/src/frontend/src/handler/create_sink.rs +++ b/src/frontend/src/handler/create_sink.rs @@ -553,7 +553,7 @@ fn check_cycle_for_sink( path.push(table.name.clone()); self.visit_table(table.as_ref(), target_table_id, path)?; path.pop(); - } else if self.source_index.get(&table_id.table_id).is_some() { + } else if self.source_index.contains_key(&table_id.table_id) { continue; } else { bail!("streaming job not found: {:?}", table_id); diff --git a/src/frontend/src/handler/create_source.rs b/src/frontend/src/handler/create_source.rs index 6691b457da610..75f89d39532c8 100644 --- a/src/frontend/src/handler/create_source.rs +++ b/src/frontend/src/handler/create_source.rs @@ -1614,7 +1614,7 @@ pub mod tests { ); // Options are not merged into props. - assert!(source.with_properties.get("schema.location").is_none()); + assert!(!source.with_properties.contains_key("schema.location")); } #[tokio::test] diff --git a/src/frontend/src/handler/create_table.rs b/src/frontend/src/handler/create_table.rs index 0c6555e766d18..1c699b3aed455 100644 --- a/src/frontend/src/handler/create_table.rs +++ b/src/frontend/src/handler/create_table.rs @@ -1415,6 +1415,6 @@ mod tests { ); // Options are not merged into props. - assert!(source.with_properties.get("schema.location").is_none()); + assert!(!source.with_properties.contains_key("schema.location")); } } diff --git a/src/frontend/src/optimizer/plan_node/generic/project.rs b/src/frontend/src/optimizer/plan_node/generic/project.rs index 10329c9f8ca91..68c652f0e006f 100644 --- a/src/frontend/src/optimizer/plan_node/generic/project.rs +++ b/src/frontend/src/optimizer/plan_node/generic/project.rs @@ -86,7 +86,7 @@ impl GenericPlanNode for Project { Some(input_idx) => { let mut field = input_schema.fields()[input_idx].clone(); if let Some(name) = self.field_names.get(&i) { - field.name = name.clone(); + field.name.clone_from(name); } (field.name, field.sub_fields, field.type_name) } diff --git a/src/frontend/src/scheduler/distributed/stage.rs b/src/frontend/src/scheduler/distributed/stage.rs index e957c81483fa1..fb7cac372bcee 100644 --- a/src/frontend/src/scheduler/distributed/stage.rs +++ b/src/frontend/src/scheduler/distributed/stage.rs @@ -93,6 +93,7 @@ pub enum StageEvent { reason: SchedulerError, }, /// All tasks in stage finished. + #[expect(dead_code)] Completed(StageId), } diff --git a/src/frontend/src/telemetry.rs b/src/frontend/src/telemetry.rs index 2141b28109feb..1c70424d93e85 100644 --- a/src/frontend/src/telemetry.rs +++ b/src/frontend/src/telemetry.rs @@ -33,6 +33,7 @@ impl FrontendTelemetryCreator { #[async_trait::async_trait] impl TelemetryReportCreator for FrontendTelemetryCreator { + #[expect(refining_impl_trait)] async fn create_report( &self, tracking_id: String, diff --git a/src/meta/src/barrier/command.rs b/src/meta/src/barrier/command.rs index c97006aa9e945..07b9c20089d00 100644 --- a/src/meta/src/barrier/command.rs +++ b/src/meta/src/barrier/command.rs @@ -323,7 +323,7 @@ pub struct CommandContext { /// Differs from [`TracedEpoch`], this span focuses on the lifetime of the corresponding /// barrier, including the process of waiting for the barrier to be sent, flowing through the /// stream graph on compute nodes, and finishing its `post_collect` stuffs. - pub span: tracing::Span, + pub _span: tracing::Span, } impl CommandContext { @@ -346,7 +346,7 @@ impl CommandContext { command, kind, barrier_manager_context, - span, + _span: span, } } diff --git a/src/meta/src/barrier/mod.rs b/src/meta/src/barrier/mod.rs index 63df19631adc2..2c17893310250 100644 --- a/src/meta/src/barrier/mod.rs +++ b/src/meta/src/barrier/mod.rs @@ -422,6 +422,7 @@ enum CompletingCommand { // that has finished but not checkpointed. If there is any, we will force checkpoint on the next barrier join_handle: JoinHandle>, }, + #[expect(dead_code)] Err(MetaError), } diff --git a/src/meta/src/hummock/compaction/picker/mod.rs b/src/meta/src/hummock/compaction/picker/mod.rs index 7e33123272684..5fcb2ea700990 100644 --- a/src/meta/src/hummock/compaction/picker/mod.rs +++ b/src/meta/src/hummock/compaction/picker/mod.rs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#![expect(dead_code)] + mod base_level_compaction_picker; mod emergency_compaction_picker; mod intra_compaction_picker; diff --git a/src/meta/src/hummock/compaction/picker/space_reclaim_compaction_picker.rs b/src/meta/src/hummock/compaction/picker/space_reclaim_compaction_picker.rs index 5d05fedbe5338..ab9f74c063a0b 100644 --- a/src/meta/src/hummock/compaction/picker/space_reclaim_compaction_picker.rs +++ b/src/meta/src/hummock/compaction/picker/space_reclaim_compaction_picker.rs @@ -24,7 +24,7 @@ use crate::hummock::level_handler::LevelHandler; // key_range and selects the appropriate files to generate compaction pub struct SpaceReclaimCompactionPicker { // config - pub max_space_reclaim_bytes: u64, + pub _max_space_reclaim_bytes: u64, // for filter pub all_table_ids: HashSet, @@ -40,7 +40,7 @@ pub struct SpaceReclaimPickerState { impl SpaceReclaimCompactionPicker { pub fn new(max_space_reclaim_bytes: u64, all_table_ids: HashSet) -> Self { Self { - max_space_reclaim_bytes, + _max_space_reclaim_bytes: max_space_reclaim_bytes, all_table_ids, } } diff --git a/src/meta/src/hummock/manager/compaction.rs b/src/meta/src/hummock/manager/compaction.rs index 065e9745f7dbb..0aa15968a8f3b 100644 --- a/src/meta/src/hummock/manager/compaction.rs +++ b/src/meta/src/hummock/manager/compaction.rs @@ -47,7 +47,7 @@ pub struct Compaction { /// `CompactStatus` of each compaction group pub compaction_statuses: BTreeMap, - pub deterministic_mode: bool, + pub _deterministic_mode: bool, } impl HummockManager { diff --git a/src/meta/src/hummock/manager/mod.rs b/src/meta/src/hummock/manager/mod.rs index eec99e2cdb9ad..3e1a4be8c4b84 100644 --- a/src/meta/src/hummock/manager/mod.rs +++ b/src/meta/src/hummock/manager/mod.rs @@ -919,7 +919,7 @@ impl HummockManager { break; } - if current_version.levels.get(&compaction_group_id).is_none() { + if !current_version.levels.contains_key(&compaction_group_id) { continue; } @@ -1051,8 +1051,9 @@ impl HummockManager { compact_task.set_task_status(TaskStatus::Success); compact_status.report_compact_task(&compact_task); if !is_trivial_reclaim { - compact_task.sorted_output_ssts = - compact_task.input_ssts[0].table_infos.clone(); + compact_task + .sorted_output_ssts + .clone_from(&compact_task.input_ssts[0].table_infos); } self.metrics .compact_frequency diff --git a/src/meta/src/manager/catalog/mod.rs b/src/meta/src/manager/catalog/mod.rs index b556ef6ddd20a..768960fae8601 100644 --- a/src/meta/src/manager/catalog/mod.rs +++ b/src/meta/src/manager/catalog/mod.rs @@ -3956,7 +3956,7 @@ impl CatalogManager { id ))); } - if user_core.catalog_create_ref_count.get(&id).is_some() { + if user_core.catalog_create_ref_count.contains_key(&id) { return Err(MetaError::permission_denied(format!( "User {} cannot be dropped because some objects depend on it", user.name diff --git a/src/meta/src/manager/metadata.rs b/src/meta/src/manager/metadata.rs index 876f5c3365d36..8dc8fa8f63275 100644 --- a/src/meta/src/manager/metadata.rs +++ b/src/meta/src/manager/metadata.rs @@ -63,6 +63,7 @@ pub struct MetadataManagerV2 { #[derive(Debug)] pub(crate) enum ActiveStreamingWorkerChange { Add(WorkerNode), + #[expect(dead_code)] Remove(WorkerNode), Update(WorkerNode), } diff --git a/src/sqlparser/tests/test_utils/mod.rs b/src/sqlparser/tests/test_utils/mod.rs index 6df188a90ff29..c72dbc33d0635 100644 --- a/src/sqlparser/tests/test_utils/mod.rs +++ b/src/sqlparser/tests/test_utils/mod.rs @@ -11,6 +11,7 @@ // limitations under the License. // Re-export everything from `src/test_utils.rs`. +#[allow(unused_imports)] pub use risingwave_sqlparser::test_utils::*; // For the test-only macros we take a different approach of keeping them here diff --git a/src/storage/compactor/src/lib.rs b/src/storage/compactor/src/lib.rs index 3ceb9f8954e3b..d9fbe5189f43f 100644 --- a/src/storage/compactor/src/lib.rs +++ b/src/storage/compactor/src/lib.rs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#![feature(lint_reasons)] + mod compactor_observer; mod rpc; pub mod server; diff --git a/src/storage/compactor/src/telemetry.rs b/src/storage/compactor/src/telemetry.rs index 2bf7aaaa3f508..c643cc6d099f3 100644 --- a/src/storage/compactor/src/telemetry.rs +++ b/src/storage/compactor/src/telemetry.rs @@ -33,6 +33,7 @@ impl CompactorTelemetryCreator { #[async_trait::async_trait] impl TelemetryReportCreator for CompactorTelemetryCreator { + #[expect(refining_impl_trait)] async fn create_report( &self, tracking_id: String, diff --git a/src/stream/src/common/compact_chunk.rs b/src/stream/src/common/compact_chunk.rs index 32dc4d0a996a6..dc5ae1561a2ba 100644 --- a/src/stream/src/common/compact_chunk.rs +++ b/src/stream/src/common/compact_chunk.rs @@ -105,7 +105,7 @@ type OpRowMap<'a, 'b> = pub enum RowOp<'a> { Insert(RowRef<'a>), Delete(RowRef<'a>), - /// (old_value, new_value) + /// (`old_value`, `new_value`) Update((RowRef<'a>, RowRef<'a>)), } static LOG_SUPPERSSER: LazyLock = LazyLock::new(LogSuppresser::default); diff --git a/src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs b/src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs index 6835b7cd2c776..d8eebaa00977c 100644 --- a/src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs +++ b/src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs @@ -40,18 +40,18 @@ pub trait UpstreamTableRead { #[derive(Debug, Default)] pub struct SnapshotReadArgs { - pub epoch: u64, + pub _epoch: u64, pub current_pos: Option, - pub ordered: bool, + pub _ordered: bool, pub chunk_size: usize, } impl SnapshotReadArgs { pub fn new_for_cdc(current_pos: Option, chunk_size: usize) -> Self { Self { - epoch: INVALID_EPOCH, + _epoch: INVALID_EPOCH, current_pos, - ordered: false, + _ordered: false, chunk_size, } } diff --git a/src/stream/src/executor/mview/materialize.rs b/src/stream/src/executor/mview/materialize.rs index 3215fdd0fc9c9..e59122c9da2a8 100644 --- a/src/stream/src/executor/mview/materialize.rs +++ b/src/stream/src/executor/mview/materialize.rs @@ -266,7 +266,7 @@ impl MaterializeExecutor { }; match mutation { // Add is for mv, index and sink creation. - Mutation::Add(AddMutation { adds, .. }) => adds.get(&actor_id).is_some(), + Mutation::Add(AddMutation { adds, .. }) => adds.contains_key(&actor_id), // AddAndUpdate is for sink-into-table. Mutation::AddAndUpdate( AddMutation { adds, .. }, @@ -276,9 +276,9 @@ impl MaterializeExecutor { .. }, ) => { - adds.get(&actor_id).is_some() - || actor_dispatchers.get(&actor_id).is_some() - || dispatchers.get(&actor_id).is_some() + adds.contains_key(&actor_id) + || actor_dispatchers.contains_key(&actor_id) + || dispatchers.contains_key(&actor_id) } Mutation::Update(_) | Mutation::Stop(_) diff --git a/src/stream/src/executor/source/source_backfill_executor.rs b/src/stream/src/executor/source/source_backfill_executor.rs index 6f8fca84bafd9..9dd9f4523a73d 100644 --- a/src/stream/src/executor/source/source_backfill_executor.rs +++ b/src/stream/src/executor/source/source_backfill_executor.rs @@ -730,11 +730,11 @@ impl SourceBackfillExecutorInner { if split_changed { stage .unfinished_splits - .retain(|split| target_state.get(split.id().as_ref()).is_some()); + .retain(|split| target_state.contains_key(split.id().as_ref())); let dropped_splits = stage .states - .extract_if(|split_id, _| target_state.get(split_id).is_none()) + .extract_if(|split_id, _| !target_state.contains_key(split_id)) .map(|(split_id, _)| split_id); if should_trim_state { @@ -823,7 +823,7 @@ impl SourceBackfillExecutorInner { ); let dropped_splits = - current_splits.extract_if(|split_id| target_splits.get(split_id).is_none()); + current_splits.extract_if(|split_id| !target_splits.contains(split_id)); if should_trim_state { // trim dropped splits' state diff --git a/src/stream/src/executor/source/source_executor.rs b/src/stream/src/executor/source/source_executor.rs index d1d21473dce21..cde886cb68cef 100644 --- a/src/stream/src/executor/source/source_executor.rs +++ b/src/stream/src/executor/source/source_executor.rs @@ -226,11 +226,11 @@ impl SourceExecutor { ); core.updated_splits_in_epoch - .retain(|split_id, _| target_state.get(split_id).is_some()); + .retain(|split_id, _| target_state.contains_key(split_id)); let dropped_splits = core .latest_split_info - .extract_if(|split_id, _| target_state.get(split_id).is_none()) + .extract_if(|split_id, _| !target_state.contains_key(split_id)) .map(|(_, split)| split) .collect_vec(); diff --git a/src/tests/compaction_test/src/lib.rs b/src/tests/compaction_test/src/lib.rs index 3d8f13e337a2a..e5fd10b10b176 100644 --- a/src/tests/compaction_test/src/lib.rs +++ b/src/tests/compaction_test/src/lib.rs @@ -44,7 +44,7 @@ pub struct CompactionTestOpts { #[clap(long)] pub client_address: Option, - /// The state store string e.g. hummock+s3://test-bucket + /// The state store string e.g. `hummock+s3://test-bucket` #[clap(short, long)] pub state_store: String, From 84d7681769a5cc02a024edc9eeeae133f9148e4f Mon Sep 17 00:00:00 2001 From: xxchan Date: Thu, 18 Apr 2024 14:25:32 +0000 Subject: [PATCH 20/39] lint Signed-off-by: xxchan --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ed9ffc3b51211..53ab89b5b2742 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -252,8 +252,7 @@ await_holding_lock = "warn" ptr_arg = "allow" # a little pedantic get_first = "allow" -# https://github.com/rust-lang/rust-clippy/issues/12016 -blocks_in_conditions = "allow" +new_without_default = "allow" # https://github.com/rust-lang/rust-clippy/issues/12537 duplicated_attributes = "allow" From e87c4e005ca00ae1aa69736bf93a904ada5f8cbc Mon Sep 17 00:00:00 2001 From: xxchan Date: Thu, 18 Apr 2024 14:27:37 +0000 Subject: [PATCH 21/39] resolve comment Signed-off-by: xxchan --- src/stream/src/common/log_store_impl/kv_log_store/serde.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/stream/src/common/log_store_impl/kv_log_store/serde.rs b/src/stream/src/common/log_store_impl/kv_log_store/serde.rs index 10f7a0eb99c88..9eb7faf237ead 100644 --- a/src/stream/src/common/log_store_impl/kv_log_store/serde.rs +++ b/src/stream/src/common/log_store_impl/kv_log_store/serde.rs @@ -43,7 +43,6 @@ use risingwave_storage::row_serde::row_serde_util::{serialize_pk, serialize_pk_w use risingwave_storage::row_serde::value_serde::ValueRowSerdeNew; use risingwave_storage::store::{StateStoreIterExt, StateStoreReadIter}; use risingwave_storage::table::{compute_vnode, TableDistribution, SINGLETON_VNODE}; -use risingwave_storage::StateStoreIter; use rw_futures_util::select_all; use crate::common::log_store_impl::kv_log_store::{ @@ -545,7 +544,7 @@ impl LogStoreRowOpStream { } } -pub(crate) type LogStoreItemMergeStream = +pub(crate) type LogStoreItemMergeStream = impl Stream>; pub(crate) fn merge_log_store_item_stream( iters: Vec, From 2df472a8b8eb288b03993391884418435369a865 Mon Sep 17 00:00:00 2001 From: xxchan Date: Thu, 18 Apr 2024 14:30:02 +0000 Subject: [PATCH 22/39] bump ci image Signed-off-by: xxchan --- ci/build-ci-image.sh | 2 +- ci/docker-compose.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/build-ci-image.sh b/ci/build-ci-image.sh index 1ec12359d896c..2c346dc3abffa 100755 --- a/ci/build-ci-image.sh +++ b/ci/build-ci-image.sh @@ -10,7 +10,7 @@ cat ../rust-toolchain # shellcheck disable=SC2155 # REMEMBER TO ALSO UPDATE ci/docker-compose.yml -export BUILD_ENV_VERSION=v20240414_x +export BUILD_ENV_VERSION=v20240418 export BUILD_TAG="public.ecr.aws/w1p7b4n3/rw-build-env:${BUILD_ENV_VERSION}" diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index c754dcc174ed1..a0b4fbe259140 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -71,7 +71,7 @@ services: retries: 5 source-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240414_x + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 depends_on: - mysql - db @@ -84,7 +84,7 @@ services: - ..:/risingwave sink-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240414_x + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 depends_on: - mysql - db @@ -103,12 +103,12 @@ services: rw-build-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240414_x + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 volumes: - ..:/risingwave ci-flamegraph-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240414_x + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 # NOTE(kwannoel): This is used in order to permit # syscalls for `nperf` (perf_event_open), # so it can do CPU profiling. @@ -119,7 +119,7 @@ services: - ..:/risingwave regress-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240414_x + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 depends_on: db: condition: service_healthy From 802ff0efb2e67cb9b499dc696070e43d89ab9f90 Mon Sep 17 00:00:00 2001 From: xxchan Date: Thu, 18 Apr 2024 15:05:28 +0000 Subject: [PATCH 23/39] lint Signed-off-by: xxchan --- src/storage/benches/bench_fs_operation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/storage/benches/bench_fs_operation.rs b/src/storage/benches/bench_fs_operation.rs index 0983883fdaa44..8d0b20987686c 100644 --- a/src/storage/benches/bench_fs_operation.rs +++ b/src/storage/benches/bench_fs_operation.rs @@ -217,6 +217,7 @@ fn gen_std_files(path: &Path) -> impl IntoIterator { .read(true) .write(true) .create(true) + .truncate(true) .open(file_path) .unwrap(); ret From e663132aa5cb715818070751bd6253fb295d3836 Mon Sep 17 00:00:00 2001 From: xxchan Date: Thu, 18 Apr 2024 15:10:35 +0000 Subject: [PATCH 24/39] fix Signed-off-by: xxchan --- Cargo.lock | 8 ++++---- src/connector/src/parser/avro/parser.rs | 3 +-- src/connector/src/parser/debezium/avro_parser.rs | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d36b0a16b3299..b8a6b3e4b5652 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,9 +79,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", @@ -5675,7 +5675,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] [[package]] @@ -6905,7 +6905,7 @@ version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7777a8bc4e68878b6e5433ac7b9bc196d9ccdfeef1f7cb3d23193cb997a520c9" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", "async-channel", "async-stream", "async-task", diff --git a/src/connector/src/parser/avro/parser.rs b/src/connector/src/parser/avro/parser.rs index 3f8098954b8d8..9ec35a02197bf 100644 --- a/src/connector/src/parser/avro/parser.rs +++ b/src/connector/src/parser/avro/parser.rs @@ -198,8 +198,7 @@ mod test { use crate::parser::plain_parser::PlainParser; use crate::parser::unified::avro::unix_epoch_days; use crate::parser::{ - AccessBuilderImpl, EncodingType, SourceStreamChunkBuilder, SourceStreamChunkBuilder, - SpecificParserConfig, SpecificParserConfig, + AccessBuilderImpl, EncodingType, SourceStreamChunkBuilder, SpecificParserConfig, }; use crate::source::{SourceColumnDesc, SourceContext}; diff --git a/src/connector/src/parser/debezium/avro_parser.rs b/src/connector/src/parser/debezium/avro_parser.rs index 62d4edbc75d77..f74e1289bf007 100644 --- a/src/connector/src/parser/debezium/avro_parser.rs +++ b/src/connector/src/parser/debezium/avro_parser.rs @@ -151,8 +151,7 @@ mod tests { use super::*; use crate::parser::{ - DebeziumAvroParserConfig, DebeziumParser, DebeziumParser, SourceStreamChunkBuilder, - SourceStreamChunkBuilder, SpecificParserConfig, SpecificParserConfig, + DebeziumAvroParserConfig, DebeziumParser, SourceStreamChunkBuilder, SpecificParserConfig, }; use crate::source::{SourceColumnDesc, SourceContext}; From 50600bf485aef9b98ed3abe7a95537399b67e1c0 Mon Sep 17 00:00:00 2001 From: xxchan Date: Fri, 19 Apr 2024 13:39:20 +0800 Subject: [PATCH 25/39] fix GHA disk out of space Signed-off-by: xxchan --- .github/workflows/nightly-rust.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/nightly-rust.yml b/.github/workflows/nightly-rust.yml index f7341323ba494..5fa90ae1138c8 100644 --- a/.github/workflows/nightly-rust.yml +++ b/.github/workflows/nightly-rust.yml @@ -14,16 +14,16 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - with: - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - remove-codeql: 'true' - remove-docker-images: 'true' - root-reserve-mb: 2048 - swap-size-mb: 8192 + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + root-reserve-mb: 10240 + temp-reserve-mb: 10240 - uses: actions/checkout@v3 if: ${{ github.event_name == 'schedule' }} with: @@ -43,3 +43,5 @@ jobs: export CARGO_INCREMENTAL=0 export CARGO_PROFILE_DEV_DEBUG=false cargo check + - name: Show available storage + run: df -h From 9cb888829334c32ac031ee2e988d6750a89a0d58 Mon Sep 17 00:00:00 2001 From: Runji Wang Date: Fri, 19 Apr 2024 15:34:41 +0800 Subject: [PATCH 26/39] update madsim Signed-off-by: Runji Wang --- Cargo.lock | 62 +++++++++++++++++++++++++-------- src/object_store/Cargo.toml | 6 ++-- src/tests/simulation/Cargo.toml | 2 +- 3 files changed, 52 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8a6b3e4b5652..5e7cdfa501cf3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -813,10 +813,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] +[[package]] +name = "async-channel" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" +dependencies = [ + "concurrent-queue", + "event-listener 5.2.0", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-compression" version = "0.4.5" @@ -856,7 +869,7 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-executor", "async-io", "async-lock", @@ -892,7 +905,7 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", ] [[package]] @@ -946,7 +959,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ "async-attributes", - "async-channel", + "async-channel 1.9.0", "async-global-executor", "async-io", "async-lock", @@ -1894,7 +1907,7 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-lock", "async-task", "atomic-waker", @@ -4594,6 +4607,27 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" +dependencies = [ + "event-listener 5.2.0", + "pin-project-lite", +] + [[package]] name = "expect-test" version = "1.5.0" @@ -5534,7 +5568,7 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1da196da473976944d408a91213bafe078e7223e10694d3f8ed36b6e210fa130" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-stream", "google-cloud-auth", "google-cloud-gax", @@ -6901,12 +6935,12 @@ dependencies = [ [[package]] name = "madsim" -version = "0.2.22" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7777a8bc4e68878b6e5433ac7b9bc196d9ccdfeef1f7cb3d23193cb997a520c9" +checksum = "c4d58385da6b81328e3e3ccb60426c0da8069a547d9979e2b11aae831089a37c" dependencies = [ - "ahash 0.7.8", - "async-channel", + "ahash 0.8.11", + "async-channel 2.2.1", "async-stream", "async-task", "bincode 1.3.3", @@ -6925,7 +6959,7 @@ dependencies = [ "spin 0.9.8", "tokio", "tokio-util", - "toml 0.7.8", + "toml 0.8.12", "tracing", "tracing-subscriber", ] @@ -6986,7 +7020,7 @@ version = "0.3.4+0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0992d46c19414bda24bad935ea223ad025dcd7e64f38f0acee388efa8ff5319b" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-trait", "futures-channel", "futures-util", @@ -9254,7 +9288,7 @@ dependencies = [ "indoc", "libc", "memoffset", - "parking_lot 0.12.1", + "parking_lot 0.11.2", "portable-atomic", "pyo3-build-config", "pyo3-ffi", @@ -13089,7 +13123,7 @@ dependencies = [ "crossbeam-queue", "dotenvy", "either", - "event-listener", + "event-listener 2.5.3", "futures-channel", "futures-core", "futures-intrusive", diff --git a/src/object_store/Cargo.toml b/src/object_store/Cargo.toml index bda496ea24f80..76c493472487e 100644 --- a/src/object_store/Cargo.toml +++ b/src/object_store/Cargo.toml @@ -23,14 +23,14 @@ crc32fast = "1" either = "1" fail = "0.5" futures = { version = "0.3", default-features = false, features = ["alloc"] } -hyper = { version = "0.14", features = ["tcp", "client"] } # required by aws sdk +hyper = { version = "0.14", features = ["tcp", "client"] } # required by aws sdk hyper-rustls = { version = "0.24.2", features = ["webpki-roots"] } hyper-tls = "0.5.0" itertools = { workspace = true } -madsim = "0.2.22" +madsim = "0.2.27" opendal = "0.45.1" prometheus = { version = "0.13", features = ["process"] } -reqwest = "0.11" # required by opendal +reqwest = "0.11" # required by opendal risingwave_common = { workspace = true } rustls = "0.23.4" spin = "0.9" diff --git a/src/tests/simulation/Cargo.toml b/src/tests/simulation/Cargo.toml index fc55e6356f4c5..31736ea848423 100644 --- a/src/tests/simulation/Cargo.toml +++ b/src/tests/simulation/Cargo.toml @@ -24,7 +24,7 @@ futures = { version = "0.3", default-features = false, features = ["alloc"] } glob = "0.3" itertools = { workspace = true } lru = { workspace = true } -madsim = "0.2.22" +madsim = "0.2.27" paste = "1" pin-project = "1.1" pretty_assertions = "1" From 210ea3b62a79a956422168f84099e7becc3c75a2 Mon Sep 17 00:00:00 2001 From: xxchan Date: Mon, 22 Apr 2024 08:18:25 +0000 Subject: [PATCH 27/39] fix clippy Signed-off-by: xxchan --- src/storage/src/hummock/iterator/change_log.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/storage/src/hummock/iterator/change_log.rs b/src/storage/src/hummock/iterator/change_log.rs index 8d6187b8cd474..77254f89def4b 100644 --- a/src/storage/src/hummock/iterator/change_log.rs +++ b/src/storage/src/hummock/iterator/change_log.rs @@ -56,10 +56,10 @@ struct ChangeLogIteratorInner< /// Indicate whether the current new value is delete. is_new_value_delete: bool, - /// Whether Indicate whether the current `old_value_iter` represents the old value in ChangeLogValue + /// Whether Indicate whether the current `old_value_iter` represents the old value in `ChangeLogValue` is_old_value_set: bool, - /// Whether the iterator is currently pointing at a valid key with ChangeLogValue + /// Whether the iterator is currently pointing at a valid key with `ChangeLogValue` is_current_pos_valid: bool, } From 6689da1913fe294407e32f214e67a1df26bda04b Mon Sep 17 00:00:00 2001 From: xxchan Date: Mon, 22 Apr 2024 08:24:41 +0000 Subject: [PATCH 28/39] more recent toolchain Signed-off-by: xxchan --- ci/build-ci-image.sh | 2 +- ci/docker-compose.yml | 10 +++++----- ci/rust-toolchain | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/build-ci-image.sh b/ci/build-ci-image.sh index 2c346dc3abffa..b1dae2e91271a 100755 --- a/ci/build-ci-image.sh +++ b/ci/build-ci-image.sh @@ -10,7 +10,7 @@ cat ../rust-toolchain # shellcheck disable=SC2155 # REMEMBER TO ALSO UPDATE ci/docker-compose.yml -export BUILD_ENV_VERSION=v20240418 +export BUILD_ENV_VERSION=v20240422 export BUILD_TAG="public.ecr.aws/w1p7b4n3/rw-build-env:${BUILD_ENV_VERSION}" diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index a0b4fbe259140..b5cec2e6abe68 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -71,7 +71,7 @@ services: retries: 5 source-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 depends_on: - mysql - db @@ -84,7 +84,7 @@ services: - ..:/risingwave sink-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 depends_on: - mysql - db @@ -103,12 +103,12 @@ services: rw-build-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 volumes: - ..:/risingwave ci-flamegraph-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 # NOTE(kwannoel): This is used in order to permit # syscalls for `nperf` (perf_event_open), # so it can do CPU profiling. @@ -119,7 +119,7 @@ services: - ..:/risingwave regress-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240418 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 depends_on: db: condition: service_healthy diff --git a/ci/rust-toolchain b/ci/rust-toolchain index 4d85754edc976..9039c2fb625ba 100644 --- a/ci/rust-toolchain +++ b/ci/rust-toolchain @@ -4,4 +4,4 @@ # 3. (optional) **follow the instructions in lints/README.md** to update the toolchain and dependencies for lints [toolchain] -channel = "nightly-2024-04-12" +channel = "nightly-2024-04-22" From 59fa2e09ce9ccf9e793d2b3c0b6d875cbb9bbbe9 Mon Sep 17 00:00:00 2001 From: MrCroxx Date: Wed, 24 Apr 2024 11:57:48 +0800 Subject: [PATCH 29/39] chore: try something new Signed-off-by: MrCroxx --- ci/build-ci-image.sh | 2 +- ci/docker-compose.yml | 10 +++++----- ci/rust-toolchain | 2 +- src/frontend/src/optimizer/logical_optimization.rs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ci/build-ci-image.sh b/ci/build-ci-image.sh index b1dae2e91271a..dd2462eb21a41 100755 --- a/ci/build-ci-image.sh +++ b/ci/build-ci-image.sh @@ -10,7 +10,7 @@ cat ../rust-toolchain # shellcheck disable=SC2155 # REMEMBER TO ALSO UPDATE ci/docker-compose.yml -export BUILD_ENV_VERSION=v20240422 +export BUILD_ENV_VERSION=v20240424 export BUILD_TAG="public.ecr.aws/w1p7b4n3/rw-build-env:${BUILD_ENV_VERSION}" diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index b5cec2e6abe68..cb0b679d9ab7c 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -71,7 +71,7 @@ services: retries: 5 source-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 depends_on: - mysql - db @@ -84,7 +84,7 @@ services: - ..:/risingwave sink-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 depends_on: - mysql - db @@ -103,12 +103,12 @@ services: rw-build-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 volumes: - ..:/risingwave ci-flamegraph-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 # NOTE(kwannoel): This is used in order to permit # syscalls for `nperf` (perf_event_open), # so it can do CPU profiling. @@ -119,7 +119,7 @@ services: - ..:/risingwave regress-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240422 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 depends_on: db: condition: service_healthy diff --git a/ci/rust-toolchain b/ci/rust-toolchain index 9039c2fb625ba..2e72736b66b39 100644 --- a/ci/rust-toolchain +++ b/ci/rust-toolchain @@ -4,4 +4,4 @@ # 3. (optional) **follow the instructions in lints/README.md** to update the toolchain and dependencies for lints [toolchain] -channel = "nightly-2024-04-22" +channel = "nightly-2024-04-24" diff --git a/src/frontend/src/optimizer/logical_optimization.rs b/src/frontend/src/optimizer/logical_optimization.rs index 834c293f212b6..cb9f7773970d6 100644 --- a/src/frontend/src/optimizer/logical_optimization.rs +++ b/src/frontend/src/optimizer/logical_optimization.rs @@ -729,8 +729,8 @@ impl LogicalOptimizer { // Do a final column pruning and predicate pushing down to clean up the plan. plan = Self::column_pruning(plan, explain_trace, &ctx); if last_total_rule_applied_before_predicate_pushdown != ctx.total_rule_applied() { - #[allow(unused_assignments)] - last_total_rule_applied_before_predicate_pushdown = ctx.total_rule_applied(); + (#[allow(unused_assignments)] + last_total_rule_applied_before_predicate_pushdown) = ctx.total_rule_applied(); plan = Self::predicate_pushdown(plan, explain_trace, &ctx); } From a9ffd0de25ae212c760f458116f36a0ec42a1d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giovanny=20Guti=C3=A9rrez?= Date: Tue, 14 May 2024 06:41:09 -0500 Subject: [PATCH 30/39] downgrade to 2024-03-12 --- ci/build-ci-image.sh | 2 +- ci/docker-compose.yml | 10 +++++----- ci/rust-toolchain | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/build-ci-image.sh b/ci/build-ci-image.sh index dd2462eb21a41..060e0fd8739b6 100755 --- a/ci/build-ci-image.sh +++ b/ci/build-ci-image.sh @@ -10,7 +10,7 @@ cat ../rust-toolchain # shellcheck disable=SC2155 # REMEMBER TO ALSO UPDATE ci/docker-compose.yml -export BUILD_ENV_VERSION=v20240424 +export BUILD_ENV_VERSION=v20240312-nightly export BUILD_TAG="public.ecr.aws/w1p7b4n3/rw-build-env:${BUILD_ENV_VERSION}" diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index cb0b679d9ab7c..5196fe4e62f4b 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -71,7 +71,7 @@ services: retries: 5 source-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240312-nightly depends_on: - mysql - db @@ -84,7 +84,7 @@ services: - ..:/risingwave sink-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240312-nightly depends_on: - mysql - db @@ -103,12 +103,12 @@ services: rw-build-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240312-nightly volumes: - ..:/risingwave ci-flamegraph-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240312-nightly # NOTE(kwannoel): This is used in order to permit # syscalls for `nperf` (perf_event_open), # so it can do CPU profiling. @@ -119,7 +119,7 @@ services: - ..:/risingwave regress-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240424 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240312-nightly depends_on: db: condition: service_healthy diff --git a/ci/rust-toolchain b/ci/rust-toolchain index 2e72736b66b39..92ef4a5ff27be 100644 --- a/ci/rust-toolchain +++ b/ci/rust-toolchain @@ -4,4 +4,4 @@ # 3. (optional) **follow the instructions in lints/README.md** to update the toolchain and dependencies for lints [toolchain] -channel = "nightly-2024-04-24" +channel = "nightly-2024-03-12" From 955ee2bcf1883938cec4f2ff6ca91a86800763b2 Mon Sep 17 00:00:00 2001 From: xxchan Date: Tue, 14 May 2024 22:40:26 +0800 Subject: [PATCH 31/39] fix lints Signed-off-by: xxchan --- Cargo.toml | 6 ++++-- src/common/src/array/arrow/arrow_impl.rs | 4 ++++ src/common/src/util/panic.rs | 2 +- src/compute/src/lib.rs | 2 +- src/compute/src/telemetry.rs | 2 +- src/connector/src/sink/snowflake_connector.rs | 1 - .../src/source/cdc/external/mock_external_table.rs | 2 +- src/expr/core/src/table_function/user_defined.rs | 3 +-- src/frontend/src/binder/bind_context.rs | 1 - src/frontend/src/binder/insert.rs | 4 ++-- src/frontend/src/binder/relation/table_function.rs | 2 +- src/frontend/src/handler/create_function.rs | 3 --- src/frontend/src/scheduler/distributed/stage.rs | 1 - src/frontend/src/telemetry.rs | 2 +- src/meta/model_v2/src/lib.rs | 2 +- src/meta/service/src/session_config.rs | 1 - src/meta/src/barrier/command.rs | 2 +- src/meta/src/barrier/info.rs | 2 +- .../compaction/picker/base_level_compaction_picker.rs | 2 +- src/meta/src/hummock/compaction/picker/mod.rs | 2 -- src/meta/src/manager/env.rs | 2 +- src/meta/src/rpc/election/sql.rs | 2 +- src/prost/src/lib.rs | 2 +- src/storage/compactor/src/telemetry.rs | 2 +- src/stream/src/executor/dynamic_filter.rs | 3 +-- src/stream/src/executor/error.rs | 2 -- src/stream/src/executor/exchange/input.rs | 5 +---- src/stream/src/executor/hash_join.rs | 4 ++-- src/stream/src/executor/join/builder.rs | 1 - src/stream/src/executor/lookup.rs | 1 - src/stream/src/executor/lookup_union.rs | 2 +- src/stream/src/executor/merge.rs | 3 +-- src/stream/src/executor/mview/materialize.rs | 2 +- src/stream/src/executor/over_window/general.rs | 3 --- src/stream/src/executor/sink.rs | 1 - src/stream/src/executor/top_n/top_n_appendonly.rs | 2 +- src/stream/src/executor/troublemaker.rs | 1 - src/stream/src/executor/watermark_filter.rs | 2 +- src/stream/src/from_proto/batch_query.rs | 1 - src/stream/src/from_proto/group_top_n.rs | 2 +- src/stream/src/from_proto/hash_join.rs | 2 +- src/stream/src/from_proto/stream_cdc_scan.rs | 2 +- 42 files changed, 37 insertions(+), 56 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7ad639628b2b8..c906f622258bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -252,8 +252,10 @@ ptr_arg = "allow" # a little pedantic get_first = "allow" new_without_default = "allow" -# https://github.com/rust-lang/rust-clippy/issues/12537 -duplicated_attributes = "allow" +# TODO: remove later https://github.com/rust-lang/rust-clippy/issues/12537 +# duplicated_attributes = "allow" +# TODO: remove later https://github.com/rust-lang/rust-clippy/issues/12436 +mixed_attributes_style = "allow" [workspace.lints.rustdoc] private_intra_doc_links = "allow" diff --git a/src/common/src/array/arrow/arrow_impl.rs b/src/common/src/array/arrow/arrow_impl.rs index 21108662c743c..773efdd088e3d 100644 --- a/src/common/src/array/arrow/arrow_impl.rs +++ b/src/common/src/array/arrow/arrow_impl.rs @@ -36,6 +36,10 @@ //! mod arrow_impl; //! ``` +// Is this a bug? Why do we have these lints? +#![allow(unused_imports)] +#![allow(dead_code)] + use std::fmt::Write; use arrow_buffer::OffsetBuffer; diff --git a/src/common/src/util/panic.rs b/src/common/src/util/panic.rs index 43db76df4f768..517a040e03b09 100644 --- a/src/common/src/util/panic.rs +++ b/src/common/src/util/panic.rs @@ -71,8 +71,8 @@ pub fn is_catching_unwind() -> bool { } #[cfg(all(test, not(madsim)))] +#[expect(clippy::disallowed_methods)] mod tests { - #![allow(clippy::disallowed_methods)] use rusty_fork::rusty_fork_test; diff --git a/src/compute/src/lib.rs b/src/compute/src/lib.rs index 344e0c781eb5e..7875aa08b5f61 100644 --- a/src/compute/src/lib.rs +++ b/src/compute/src/lib.rs @@ -91,7 +91,7 @@ pub struct ComputeNodeOpts { pub total_memory_bytes: usize, /// Reserved memory for the compute node in bytes. - /// If not set, a portion (default to 30%) for the total_memory_bytes will be used as the reserved memory. + /// If not set, a portion (default to 30%) for the `total_memory_bytes` will be used as the reserved memory. /// /// The total memory compute and storage can use is `total_memory_bytes` - `reserved_memory_bytes`. #[clap(long, env = "RW_RESERVED_MEMORY_BYTES")] diff --git a/src/compute/src/telemetry.rs b/src/compute/src/telemetry.rs index b1165175ca6bf..c35a6063ae267 100644 --- a/src/compute/src/telemetry.rs +++ b/src/compute/src/telemetry.rs @@ -33,7 +33,7 @@ impl ComputeTelemetryCreator { #[async_trait::async_trait] impl TelemetryReportCreator for ComputeTelemetryCreator { - #[expect(refining_impl_trait)] + #[allow(refining_impl_trait)] async fn create_report( &self, tracking_id: String, diff --git a/src/connector/src/sink/snowflake_connector.rs b/src/connector/src/sink/snowflake_connector.rs index eee4af2258b09..ee1cb90b70a52 100644 --- a/src/connector/src/sink/snowflake_connector.rs +++ b/src/connector/src/sink/snowflake_connector.rs @@ -19,7 +19,6 @@ use std::time::{SystemTime, UNIX_EPOCH}; use anyhow::{anyhow, Context}; use jsonwebtoken::{encode, Algorithm, EncodingKey, Header}; use reqwest::{header, Client, RequestBuilder, StatusCode}; -use risingwave_common::config::ObjectStoreConfig; use risingwave_object_store::object::*; use serde::{Deserialize, Serialize}; diff --git a/src/connector/src/source/cdc/external/mock_external_table.rs b/src/connector/src/source/cdc/external/mock_external_table.rs index fcfb1505225ea..7242f5614d409 100644 --- a/src/connector/src/source/cdc/external/mock_external_table.rs +++ b/src/connector/src/source/cdc/external/mock_external_table.rs @@ -86,7 +86,7 @@ impl MockExternalTableReader { ]), ]; - let snapshots = vec![snap0]; + let snapshots = [snap0]; if snap_idx >= snapshots.len() { return Ok(()); } diff --git a/src/expr/core/src/table_function/user_defined.rs b/src/expr/core/src/table_function/user_defined.rs index e36c732e97692..79b14a126f10d 100644 --- a/src/expr/core/src/table_function/user_defined.rs +++ b/src/expr/core/src/table_function/user_defined.rs @@ -23,9 +23,8 @@ use arrow_udf_js_deno::{CallMode as DenoCallMode, Runtime as DenoRuntime}; #[cfg(feature = "embedded-python-udf")] use arrow_udf_python::{CallMode as PythonCallMode, Runtime as PythonRuntime}; use cfg_or_panic::cfg_or_panic; -use futures_util::stream; use risingwave_common::array::arrow::{FromArrow, ToArrow, UdfArrowConvert}; -use risingwave_common::array::{DataChunk, I32Array}; +use risingwave_common::array::I32Array; use risingwave_common::bail; use super::*; diff --git a/src/frontend/src/binder/bind_context.rs b/src/frontend/src/binder/bind_context.rs index 8c493005e5c3e..7a52de7decec4 100644 --- a/src/frontend/src/binder/bind_context.rs +++ b/src/frontend/src/binder/bind_context.rs @@ -107,7 +107,6 @@ pub enum BindingCteState { pub struct RecursiveUnion { /// currently this *must* be true, /// otherwise binding will fail. - #[expect(dead_code)] pub all: bool, /// lhs part of the `UNION ALL` operator pub base: Box, diff --git a/src/frontend/src/binder/insert.rs b/src/frontend/src/binder/insert.rs index 1cc719d066420..e0b5ce422e75a 100644 --- a/src/frontend/src/binder/insert.rs +++ b/src/frontend/src/binder/insert.rs @@ -175,14 +175,14 @@ impl Binder { // is given and it is NOT equivalent to assignment cast over potential implicit cast inside. // For example, the following is valid: // - // ``` + // ```sql // create table t (v1 time); // insert into t values (timestamp '2020-01-01 01:02:03'), (time '03:04:05'); // ``` // // But the followings are not: // - // ``` + // ```sql // values (timestamp '2020-01-01 01:02:03'), (time '03:04:05'); // insert into t values (timestamp '2020-01-01 01:02:03'), (time '03:04:05') limit 1; // ``` diff --git a/src/frontend/src/binder/relation/table_function.rs b/src/frontend/src/binder/relation/table_function.rs index 9189e176e0d55..efb4de3c55510 100644 --- a/src/frontend/src/binder/relation/table_function.rs +++ b/src/frontend/src/binder/relation/table_function.rs @@ -143,7 +143,7 @@ impl Binder { // Note: named return value should take precedence over table alias. // But we don't support it yet. // e.g., - // ``` + // ```sql // > create function foo(ret out int) language sql as 'select 1'; // > select t.ret from foo() as t; // ``` diff --git a/src/frontend/src/handler/create_function.rs b/src/frontend/src/handler/create_function.rs index 471145a12a3e4..c6cafdea37fa7 100644 --- a/src/frontend/src/handler/create_function.rs +++ b/src/frontend/src/handler/create_function.rs @@ -15,15 +15,12 @@ use anyhow::Context; use arrow_schema::Fields; use bytes::Bytes; -use itertools::Itertools; -use pgwire::pg_response::StatementType; use risingwave_common::array::arrow::{ToArrow, UdfArrowConvert}; use risingwave_common::catalog::FunctionId; use risingwave_common::types::DataType; use risingwave_expr::expr::{get_or_create_flight_client, get_or_create_wasm_runtime}; use risingwave_pb::catalog::function::{Kind, ScalarFunction, TableFunction}; use risingwave_pb::catalog::Function; -use risingwave_sqlparser::ast::{CreateFunctionBody, ObjectName, OperateFunctionArg}; use super::*; use crate::catalog::CatalogError; diff --git a/src/frontend/src/scheduler/distributed/stage.rs b/src/frontend/src/scheduler/distributed/stage.rs index 515c17bdefe55..59294169220e7 100644 --- a/src/frontend/src/scheduler/distributed/stage.rs +++ b/src/frontend/src/scheduler/distributed/stage.rs @@ -94,7 +94,6 @@ pub enum StageEvent { reason: SchedulerError, }, /// All tasks in stage finished. - #[expect(dead_code)] Completed(StageId), } diff --git a/src/frontend/src/telemetry.rs b/src/frontend/src/telemetry.rs index 1c70424d93e85..d50b9999b946f 100644 --- a/src/frontend/src/telemetry.rs +++ b/src/frontend/src/telemetry.rs @@ -33,7 +33,7 @@ impl FrontendTelemetryCreator { #[async_trait::async_trait] impl TelemetryReportCreator for FrontendTelemetryCreator { - #[expect(refining_impl_trait)] + #[allow(refining_impl_trait)] async fn create_report( &self, tracking_id: String, diff --git a/src/meta/model_v2/src/lib.rs b/src/meta/model_v2/src/lib.rs index b34cd5e73e6ce..87d7e3e3597f6 100644 --- a/src/meta/model_v2/src/lib.rs +++ b/src/meta/model_v2/src/lib.rs @@ -256,7 +256,7 @@ macro_rules! derive_array_from_blob { }; } -pub(crate) use {derive_array_from_blob, derive_from_blob, derive_from_json_struct}; +pub(crate) use {derive_array_from_blob, derive_from_blob}; derive_from_json_struct!(I32Array, Vec); diff --git a/src/meta/service/src/session_config.rs b/src/meta/service/src/session_config.rs index a4a7d1b70591a..a3999a3d27426 100644 --- a/src/meta/service/src/session_config.rs +++ b/src/meta/service/src/session_config.rs @@ -19,7 +19,6 @@ use risingwave_pb::meta::{ GetSessionParamsRequest, GetSessionParamsResponse, SetSessionParamRequest, SetSessionParamResponse, }; -use serde_json; use thiserror_ext::AsReport; use tonic::{Request, Response, Status}; diff --git a/src/meta/src/barrier/command.rs b/src/meta/src/barrier/command.rs index 935d5a90a14a5..865835c49edeb 100644 --- a/src/meta/src/barrier/command.rs +++ b/src/meta/src/barrier/command.rs @@ -95,7 +95,7 @@ pub struct ReplaceTablePlan { /// We need to reassign splits for it. /// /// Note that there's no `SourceBackfillExecutor` involved for table with connector, so we don't need to worry about - /// backfill_splits. + /// `backfill_splits`. pub init_split_assignment: SplitAssignment, } diff --git a/src/meta/src/barrier/info.rs b/src/meta/src/barrier/info.rs index e07cb705b26a1..aa8882d438dce 100644 --- a/src/meta/src/barrier/info.rs +++ b/src/meta/src/barrier/info.rs @@ -51,7 +51,7 @@ pub struct InflightActorInfo { /// `actor_id` => `WorkerId` pub actor_location_map: HashMap, - /// mv_table_id => subscription_id => retention seconds + /// `mv_table_id` => `subscription_id` => retention seconds pub mv_depended_subscriptions: HashMap>, } diff --git a/src/meta/src/hummock/compaction/picker/base_level_compaction_picker.rs b/src/meta/src/hummock/compaction/picker/base_level_compaction_picker.rs index a3345a0723fc3..f98e14203d95b 100644 --- a/src/meta/src/hummock/compaction/picker/base_level_compaction_picker.rs +++ b/src/meta/src/hummock/compaction/picker/base_level_compaction_picker.rs @@ -30,7 +30,7 @@ use crate::hummock::compaction::{create_overlap_strategy, CompactionDeveloperCon use crate::hummock::level_handler::LevelHandler; std::thread_local! { - static LOG_COUNTER: RefCell = RefCell::new(0); + static LOG_COUNTER: RefCell = const { RefCell::new(0) }; } pub struct LevelCompactionPicker { diff --git a/src/meta/src/hummock/compaction/picker/mod.rs b/src/meta/src/hummock/compaction/picker/mod.rs index 5fcb2ea700990..7e33123272684 100644 --- a/src/meta/src/hummock/compaction/picker/mod.rs +++ b/src/meta/src/hummock/compaction/picker/mod.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![expect(dead_code)] - mod base_level_compaction_picker; mod emergency_compaction_picker; mod intra_compaction_picker; diff --git a/src/meta/src/manager/env.rs b/src/meta/src/manager/env.rs index 5006f5864e84f..1d9ef9fc27452 100644 --- a/src/meta/src/manager/env.rs +++ b/src/meta/src/manager/env.rs @@ -275,7 +275,7 @@ pub struct MetaOpts { /// The maximum number of trivial move tasks to be picked in a single loop pub max_trivial_move_task_count_per_loop: usize, - /// The maximum number of times to probe for PullTaskEvent + /// The maximum number of times to probe for `PullTaskEvent` pub max_get_task_probe_times: usize, } diff --git a/src/meta/src/rpc/election/sql.rs b/src/meta/src/rpc/election/sql.rs index 49dd0474d4975..9ec5bd199cf76 100644 --- a/src/meta/src/rpc/election/sql.rs +++ b/src/meta/src/rpc/election/sql.rs @@ -715,7 +715,7 @@ where break; } else if prev_leader != election_row.id { tracing::info!("leader is {}", election_row.id); - prev_leader = election_row.id.clone(); + prev_leader.clone_from(&election_row.id) } timeout_ticker.reset(); diff --git a/src/prost/src/lib.rs b/src/prost/src/lib.rs index 825e721891fed..d4f0359fadab2 100644 --- a/src/prost/src/lib.rs +++ b/src/prost/src/lib.rs @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +// for derived code of `Message` #![expect(clippy::all)] #![expect(clippy::doc_markdown)] -#![allow(non_snake_case)] // for derived code of `Message` #![feature(lint_reasons)] use std::str::FromStr; diff --git a/src/storage/compactor/src/telemetry.rs b/src/storage/compactor/src/telemetry.rs index c643cc6d099f3..b01fdd1e258f3 100644 --- a/src/storage/compactor/src/telemetry.rs +++ b/src/storage/compactor/src/telemetry.rs @@ -33,7 +33,7 @@ impl CompactorTelemetryCreator { #[async_trait::async_trait] impl TelemetryReportCreator for CompactorTelemetryCreator { - #[expect(refining_impl_trait)] + #[allow(refining_impl_trait)] async fn create_report( &self, tracking_id: String, diff --git a/src/stream/src/executor/dynamic_filter.rs b/src/stream/src/executor/dynamic_filter.rs index ddbe8352b2e8a..eb2a0648225d3 100644 --- a/src/stream/src/executor/dynamic_filter.rs +++ b/src/stream/src/executor/dynamic_filter.rs @@ -13,7 +13,6 @@ // limitations under the License. use std::ops::Bound::{self, *}; -use std::sync::Arc; use futures::stream; use risingwave_common::array::{Array, ArrayImpl, Op}; @@ -21,7 +20,7 @@ use risingwave_common::bail; use risingwave_common::buffer::{Bitmap, BitmapBuilder}; use risingwave_common::hash::VnodeBitmapExt; use risingwave_common::row::{self, once, OwnedRow as RowData}; -use risingwave_common::types::{DataType, Datum, DefaultOrd, ScalarImpl, ToDatumRef, ToOwnedDatum}; +use risingwave_common::types::{DefaultOrd, ToDatumRef, ToOwnedDatum}; use risingwave_common::util::iter_util::ZipEqDebug; use risingwave_expr::expr::{ build_func_non_strict, InputRefExpression, LiteralExpression, NonStrictExpression, diff --git a/src/stream/src/executor/error.rs b/src/stream/src/executor/error.rs index b1f411b2a4ec7..41b8198b646a3 100644 --- a/src/stream/src/executor/error.rs +++ b/src/stream/src/executor/error.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::convert::AsRef; - use risingwave_common::array::ArrayError; use risingwave_common::error::{BoxedError, NotImplemented}; use risingwave_common::util::value_encoding::error::ValueEncodingError; diff --git a/src/stream/src/executor/exchange/input.rs b/src/stream/src/executor/exchange/input.rs index 11796441326aa..0fc4845476db0 100644 --- a/src/stream/src/executor/exchange/input.rs +++ b/src/stream/src/executor/exchange/input.rs @@ -16,7 +16,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; use anyhow::Context as _; -use futures::{pin_mut, Stream}; +use futures::pin_mut; use futures_async_stream::try_stream; use pin_project::pin_project; use risingwave_common::util::addr::{is_local_address, HostAddr}; @@ -25,9 +25,6 @@ use risingwave_rpc_client::ComputeClientPool; use super::error::ExchangeChannelClosed; use super::permit::Receiver; -use crate::error::StreamResult; -use crate::executor::error::StreamExecutorError; -use crate::executor::monitor::StreamingMetrics; use crate::executor::prelude::*; use crate::task::{ FragmentId, LocalBarrierManager, SharedContext, UpDownActorIds, UpDownFragmentIds, diff --git a/src/stream/src/executor/hash_join.rs b/src/stream/src/executor/hash_join.rs index ea0253c9cbbc1..a06d490400cdc 100644 --- a/src/stream/src/executor/hash_join.rs +++ b/src/stream/src/executor/hash_join.rs @@ -17,7 +17,7 @@ use std::time::Duration; use itertools::Itertools; use multimap::MultiMap; -use risingwave_common::array::{Op, RowRef}; +use risingwave_common::array::Op; use risingwave_common::hash::{HashKey, NullBitmap}; use risingwave_common::types::{DefaultOrd, ToOwnedDatum}; use risingwave_common::util::epoch::EpochPair; @@ -30,7 +30,7 @@ use self::builder::JoinChunkBuilder; use super::barrier_align::*; use super::join::hash_join::*; use super::join::row::JoinRow; -use super::join::{JoinTypePrimitive, SideTypePrimitive, *}; +use super::join::*; use super::watermark::*; use crate::executor::join::builder::JoinStreamChunkBuilder; use crate::executor::prelude::*; diff --git a/src/stream/src/executor/join/builder.rs b/src/stream/src/executor/join/builder.rs index ca34ba9cad9e8..72208aa45ded8 100644 --- a/src/stream/src/executor/join/builder.rs +++ b/src/stream/src/executor/join/builder.rs @@ -20,7 +20,6 @@ use risingwave_common::types::{DataType, DatumRef}; use self::row::JoinRow; // Re-export `StreamChunkBuilder`. use super::*; -use super::{JoinTypePrimitive, SideTypePrimitive}; type IndexMappings = Vec<(usize, usize)>; diff --git a/src/stream/src/executor/lookup.rs b/src/stream/src/executor/lookup.rs index 8d62d27e37f06..6dc4183fe27da 100644 --- a/src/stream/src/executor/lookup.rs +++ b/src/stream/src/executor/lookup.rs @@ -13,7 +13,6 @@ // limitations under the License. use async_trait::async_trait; -use futures::StreamExt; mod cache; mod sides; diff --git a/src/stream/src/executor/lookup_union.rs b/src/stream/src/executor/lookup_union.rs index 2189a821fab11..62f3a0cfcb350 100644 --- a/src/stream/src/executor/lookup_union.rs +++ b/src/stream/src/executor/lookup_union.rs @@ -15,7 +15,7 @@ use async_trait::async_trait; use futures::channel::mpsc; use futures::future::{join_all, select, Either}; -use futures::{FutureExt, SinkExt, StreamExt}; +use futures::{FutureExt, SinkExt}; use itertools::Itertools; use crate::executor::prelude::*; diff --git a/src/stream/src/executor/merge.rs b/src/stream/src/executor/merge.rs index 7a5450716f9ac..96d9826be5994 100644 --- a/src/stream/src/executor/merge.rs +++ b/src/stream/src/executor/merge.rs @@ -18,7 +18,6 @@ use std::task::{Context, Poll}; use anyhow::Context as _; use futures::stream::{FusedStream, FuturesUnordered, StreamFuture}; -use futures::StreamExt; use tokio::time::Instant; use super::exchange::input::BoxedInput; @@ -27,7 +26,7 @@ use super::*; use crate::executor::exchange::input::new_input; use crate::executor::prelude::*; use crate::executor::utils::ActorInputMetrics; -use crate::task::{FragmentId, SharedContext}; +use crate::task::SharedContext; /// `MergeExecutor` merges data from multiple channels. Dataflow from one channel /// will be stopped on barrier. diff --git a/src/stream/src/executor/mview/materialize.rs b/src/stream/src/executor/mview/materialize.rs index 65c35e2094b73..7aff6e33745dc 100644 --- a/src/stream/src/executor/mview/materialize.rs +++ b/src/stream/src/executor/mview/materialize.rs @@ -24,7 +24,7 @@ use itertools::Itertools; use risingwave_common::array::Op; use risingwave_common::buffer::Bitmap; use risingwave_common::catalog::{ColumnDesc, ColumnId, ConflictBehavior, TableId}; -use risingwave_common::row::{CompactedRow, OwnedRow, RowDeserializer}; +use risingwave_common::row::{CompactedRow, RowDeserializer}; use risingwave_common::types::DefaultOrd; use risingwave_common::util::chunk_coalesce::DataChunkBuilder; use risingwave_common::util::iter_util::{ZipEqDebug, ZipEqFast}; diff --git a/src/stream/src/executor/over_window/general.rs b/src/stream/src/executor/over_window/general.rs index 7cb29c39f7e37..c8ed97f8c59c1 100644 --- a/src/stream/src/executor/over_window/general.rs +++ b/src/stream/src/executor/over_window/general.rs @@ -30,7 +30,6 @@ use risingwave_expr::window_function::{ create_window_state, StateKey, WindowFuncCall, WindowStates, }; use risingwave_storage::row_serde::row_serde_util::serialize_pk_with_vnode; -use risingwave_storage::StateStore; use super::over_partition::{ new_empty_partition_cache, shrink_partition_cache, CacheKey, OverPartition, PartitionCache, @@ -38,8 +37,6 @@ use super::over_partition::{ }; use crate::cache::{new_unbounded, ManagedLruCache}; use crate::common::metrics::MetricsInfo; -use crate::common::table::state_table::StateTable; -use crate::executor::monitor::StreamingMetrics; use crate::executor::over_window::over_partition::AffectedRange; use crate::executor::prelude::*; diff --git a/src/stream/src/executor/sink.rs b/src/stream/src/executor/sink.rs index 1bd8d5e5c96a4..1de9f65e19c1b 100644 --- a/src/stream/src/executor/sink.rs +++ b/src/stream/src/executor/sink.rs @@ -15,7 +15,6 @@ use std::mem; use anyhow::anyhow; -use await_tree::InstrumentAwait; use futures::stream::select; use futures::{FutureExt, TryFutureExt, TryStreamExt}; use itertools::Itertools; diff --git a/src/stream/src/executor/top_n/top_n_appendonly.rs b/src/stream/src/executor/top_n/top_n_appendonly.rs index c99b911b951ef..1b45c82c9c83a 100644 --- a/src/stream/src/executor/top_n/top_n_appendonly.rs +++ b/src/stream/src/executor/top_n/top_n_appendonly.rs @@ -19,7 +19,7 @@ use risingwave_common::util::sort_util::ColumnOrder; use super::top_n_cache::AppendOnlyTopNCacheTrait; use super::utils::*; -use super::{ManagedTopNState, TopNCache, NO_GROUP_KEY}; +use super::{ManagedTopNState, TopNCache}; use crate::executor::prelude::*; /// If the input is append-only, `AppendOnlyGroupTopNExecutor` does not need diff --git a/src/stream/src/executor/troublemaker.rs b/src/stream/src/executor/troublemaker.rs index 7b93392fef419..95b7ad70f7a1f 100644 --- a/src/stream/src/executor/troublemaker.rs +++ b/src/stream/src/executor/troublemaker.rs @@ -13,7 +13,6 @@ // limitations under the License. use rand::Rng; -use risingwave_common::array::stream_chunk_builder::StreamChunkBuilder; use risingwave_common::array::stream_record::{Record, RecordType}; use risingwave_common::array::Op; use risingwave_common::field_generator::{FieldGeneratorImpl, VarcharProperty}; diff --git a/src/stream/src/executor/watermark_filter.rs b/src/stream/src/executor/watermark_filter.rs index 813ccbef28920..c966d0411acbb 100644 --- a/src/stream/src/executor/watermark_filter.rs +++ b/src/stream/src/executor/watermark_filter.rs @@ -17,7 +17,7 @@ use std::ops::Deref; use futures::future::{try_join, try_join_all}; use risingwave_common::hash::VnodeBitmapExt; -use risingwave_common::types::{DefaultOrd, ScalarImpl}; +use risingwave_common::types::DefaultOrd; use risingwave_common::{bail, row}; use risingwave_expr::expr::{ build_func_non_strict, ExpressionBoxExt, InputRefExpression, LiteralExpression, diff --git a/src/stream/src/from_proto/batch_query.rs b/src/stream/src/from_proto/batch_query.rs index 5e86d7e6d5b30..a1659008724e7 100644 --- a/src/stream/src/from_proto/batch_query.rs +++ b/src/stream/src/from_proto/batch_query.rs @@ -16,7 +16,6 @@ use risingwave_common::catalog::ColumnId; use risingwave_pb::plan_common::StorageTableDesc; use risingwave_pb::stream_plan::BatchPlanNode; use risingwave_storage::table::batch_table::storage_table::StorageTable; -use risingwave_storage::StateStore; use super::*; use crate::executor::{BatchQueryExecutor, DummyExecutor}; diff --git a/src/stream/src/from_proto/group_top_n.rs b/src/stream/src/from_proto/group_top_n.rs index 51512cb9d94d3..fe5dfc1042cc8 100644 --- a/src/stream/src/from_proto/group_top_n.rs +++ b/src/stream/src/from_proto/group_top_n.rs @@ -22,7 +22,7 @@ use risingwave_pb::stream_plan::GroupTopNNode; use super::*; use crate::common::table::state_table::StateTable; -use crate::executor::{ActorContextRef, AppendOnlyGroupTopNExecutor, Executor, GroupTopNExecutor}; +use crate::executor::{ActorContextRef, AppendOnlyGroupTopNExecutor, GroupTopNExecutor}; use crate::task::AtomicU64Ref; pub struct GroupTopNExecutorBuilder; diff --git a/src/stream/src/from_proto/hash_join.rs b/src/stream/src/from_proto/hash_join.rs index ad69fd1ecd5ac..28a6aa72d4a6f 100644 --- a/src/stream/src/from_proto/hash_join.rs +++ b/src/stream/src/from_proto/hash_join.rs @@ -27,7 +27,7 @@ use super::*; use crate::common::table::state_table::StateTable; use crate::executor::hash_join::*; use crate::executor::monitor::StreamingMetrics; -use crate::executor::{ActorContextRef, Executor, JoinType}; +use crate::executor::{ActorContextRef, JoinType}; use crate::task::AtomicU64Ref; pub struct HashJoinExecutorBuilder; diff --git a/src/stream/src/from_proto/stream_cdc_scan.rs b/src/stream/src/from_proto/stream_cdc_scan.rs index a55afa6c2da78..43ddffda00607 100644 --- a/src/stream/src/from_proto/stream_cdc_scan.rs +++ b/src/stream/src/from_proto/stream_cdc_scan.rs @@ -23,7 +23,7 @@ use risingwave_pb::stream_plan::StreamCdcScanNode; use super::*; use crate::common::table::state_table::StateTable; -use crate::executor::{CdcBackfillExecutor, CdcScanOptions, Executor, ExternalStorageTable}; +use crate::executor::{CdcBackfillExecutor, CdcScanOptions, ExternalStorageTable}; pub struct StreamCdcScanExecutorBuilder; From ed09ac74cae7b481bde104e9c46d071267b43f70 Mon Sep 17 00:00:00 2001 From: xxchan Date: Tue, 14 May 2024 23:00:40 +0800 Subject: [PATCH 32/39] fix lints Signed-off-by: xxchan --- lints/rust-toolchain | 2 +- src/utils/delta_btree_map/src/lib.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lints/rust-toolchain b/lints/rust-toolchain index ea1f0e928e5c3..f87f99fcc3cfa 100644 --- a/lints/rust-toolchain +++ b/lints/rust-toolchain @@ -1,5 +1,5 @@ # See `README.md` before bumping the version. [toolchain] -channel = "nightly-2024-01-11" +channel = "nightly-2024-03-12" components = ["llvm-tools-preview", "rustc-dev"] diff --git a/src/utils/delta_btree_map/src/lib.rs b/src/utils/delta_btree_map/src/lib.rs index 33eb0cf1c175b..1f7e1a77190a0 100644 --- a/src/utils/delta_btree_map/src/lib.rs +++ b/src/utils/delta_btree_map/src/lib.rs @@ -287,8 +287,6 @@ impl<'a, K: Ord, V> CursorWithDelta<'a, K, V> { #[cfg(test)] mod tests { - use std::collections::BTreeMap; - use super::*; #[test] From 9cc432a8df26af41b0e0fda98c4624e9b04a304e Mon Sep 17 00:00:00 2001 From: xxchan Date: Tue, 14 May 2024 23:20:30 +0800 Subject: [PATCH 33/39] fix dylint Signed-off-by: xxchan --- lints/Cargo.lock | 185 ++++++++++++++++++++++++++++--------------- lints/Cargo.toml | 6 +- lints/rust-toolchain | 2 +- 3 files changed, 123 insertions(+), 70 deletions(-) diff --git a/lints/Cargo.lock b/lints/Cargo.lock index b8fd465fecd7b..3ffb99c6c425e 100644 --- a/lints/Cargo.lock +++ b/lints/Cargo.lock @@ -20,6 +20,55 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.75" @@ -40,9 +89,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -113,8 +162,8 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clippy_config" -version = "0.1.77" -source = "git+https://github.com/rust-lang/rust-clippy?rev=6fd0258e45105161b7e759a22e7350958e5cb0b1#6fd0258e45105161b7e759a22e7350958e5cb0b1" +version = "0.1.79" +source = "git+https://github.com/rust-lang/rust-clippy?rev=9d6f41691ed9dbfaec2a2df2661c42451f2fe0d3#9d6f41691ed9dbfaec2a2df2661c42451f2fe0d3" dependencies = [ "rustc-semver", "serde", @@ -123,15 +172,21 @@ dependencies = [ [[package]] name = "clippy_utils" -version = "0.1.77" -source = "git+https://github.com/rust-lang/rust-clippy?rev=6fd0258e45105161b7e759a22e7350958e5cb0b1#6fd0258e45105161b7e759a22e7350958e5cb0b1" +version = "0.1.79" +source = "git+https://github.com/rust-lang/rust-clippy?rev=9d6f41691ed9dbfaec2a2df2661c42451f2fe0d3#9d6f41691ed9dbfaec2a2df2661c42451f2fe0d3" dependencies = [ "arrayvec", "clippy_config", - "itertools 0.11.0", + "itertools", "rustc-semver", ] +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + [[package]] name = "compiletest_rs" version = "0.10.2" @@ -233,9 +288,9 @@ dependencies = [ [[package]] name = "dylint" -version = "2.6.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fdb7b800ab13925402f0048ed0911068db2e5ba6168dd93962269d4f39541d" +checksum = "4c6720f18fdd779ad137ab6bc448c11042b1b32eea625ea618c8b953660bba56" dependencies = [ "ansi_term", "anyhow", @@ -254,12 +309,13 @@ dependencies = [ [[package]] name = "dylint_internal" -version = "2.6.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5154dada2bee2a69f75f54eae57479f56f93ca1db80725a1d82cdb5fe231ef73" +checksum = "395dade88bc1a3103ef91b442498943d0072df869736a7c0107a5753c05d006f" dependencies = [ "ansi_term", "anyhow", + "bitflags 2.5.0", "cargo_metadata", "git2", "home", @@ -267,15 +323,18 @@ dependencies = [ "is-terminal", "log", "once_cell", + "regex", "rust-embed", - "sedregex", + "serde", + "thiserror", + "toml 0.8.8", ] [[package]] name = "dylint_linting" -version = "2.6.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d203baeb8770847314632f652e0e62dd7fec6a21102a116472eec0d6931f5dd9" +checksum = "3d070f934310ccf8f04a940affcce0cd196c1068b6d19c5ae6d975f926968b66" dependencies = [ "cargo_metadata", "dylint_internal", @@ -288,9 +347,9 @@ dependencies = [ [[package]] name = "dylint_testing" -version = "2.6.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1208b1f2c40fc2f3c3fa0d5631efbc7a95721d619410dc2da5b0496810d6a941" +checksum = "7fc8a64c781bde7f1e445dc1205754994012e15a2a6e659ab7166b380c1c22ab" dependencies = [ "anyhow", "cargo_metadata", @@ -310,17 +369,27 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" -version = "0.10.1" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] [[package]] @@ -402,7 +471,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "libc", "libgit2-sys", "log", @@ -489,13 +558,10 @@ dependencies = [ ] [[package]] -name = "itertools" -version = "0.11.0" +name = "is_terminal_polyfill" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" @@ -529,9 +595,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libgit2-sys" @@ -553,7 +619,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "libc", "redox_syscall 0.4.1", ] @@ -592,7 +658,7 @@ dependencies = [ "clippy_utils", "dylint_linting", "dylint_testing", - "itertools 0.12.0", + "itertools", "thiserror-ext", "tracing", ] @@ -605,9 +671,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" @@ -766,9 +832,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rust-embed" -version = "8.2.0" +version = "8.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82c0bbc10308ed323529fd3c1dce8badda635aa319a5ff0e6466f33b8101e3f" +checksum = "19549741604902eb99a7ed0ee177a0663ee1eda51a29f71401f166e47e77806a" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -777,9 +843,9 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.2.0" +version = "8.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6227c01b1783cdfee1bcf844eb44594cd16ec71c35305bf1c9fb5aade2735e16" +checksum = "cb9f96e283ec64401f30d3df8ee2aaeb2561f34c824381efa24a35f79bf40ee4" dependencies = [ "proc-macro2", "quote", @@ -790,9 +856,9 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "8.2.0" +version = "8.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb0a25bfbb2d4b4402179c2cf030387d9990857ce08a32592c6238db9fa8665" +checksum = "38c74a686185620830701348de757fd36bef4aa9680fd23c49fc539ddcc1af32" dependencies = [ "globset", "sha2", @@ -819,11 +885,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -851,15 +917,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "sedregex" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19411e23596093f03bbd11dc45603b6329bb4bfec77b9fd13e2b9fc9b02efe3e" -dependencies = [ - "regex", -] - [[package]] name = "semver" version = "1.0.20" @@ -933,13 +990,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.4.1", "rustix", "windows-sys 0.52.0", ] @@ -955,15 +1011,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "termcolor" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" -dependencies = [ - "winapi-util", -] - [[package]] name = "tester" version = "0.9.1" @@ -1168,6 +1215,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "vcpkg" version = "0.2.15" @@ -1182,9 +1235,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", diff --git a/lints/Cargo.toml b/lints/Cargo.toml index 14bd09faca184..2581c1d3f0483 100644 --- a/lints/Cargo.toml +++ b/lints/Cargo.toml @@ -14,12 +14,12 @@ path = "ui/format_error.rs" # See `README.md` before bumping the version. # Remember to update the version in `ci/Dockerfile` as well. [dependencies] -clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "6fd0258e45105161b7e759a22e7350958e5cb0b1" } -dylint_linting = "2.6.0" +clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "9d6f41691ed9dbfaec2a2df2661c42451f2fe0d3" } +dylint_linting = "3.1.0" itertools = "0.12" [dev-dependencies] -dylint_testing = "2.6.0" +dylint_testing = "3.1.0" # UI test dependencies anyhow = "1" diff --git a/lints/rust-toolchain b/lints/rust-toolchain index f87f99fcc3cfa..e79f69d40f86e 100644 --- a/lints/rust-toolchain +++ b/lints/rust-toolchain @@ -1,5 +1,5 @@ # See `README.md` before bumping the version. [toolchain] -channel = "nightly-2024-03-12" +channel = "nightly-2024-03-21" components = ["llvm-tools-preview", "rustc-dev"] From f24e0d218d7fc82c1fb5ceeda1e999ad82df2089 Mon Sep 17 00:00:00 2001 From: xxchan Date: Tue, 14 May 2024 23:27:20 +0800 Subject: [PATCH 34/39] fix dylint Signed-off-by: xxchan --- ci/Dockerfile | 2 +- ci/build-ci-image.sh | 2 +- ci/docker-compose.yml | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index d91853232f626..616af35fd118e 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -76,7 +76,7 @@ RUN cargo binstall -y --no-symlinks cargo-llvm-cov cargo-nextest cargo-hakari ca && rm -rf "/root/.cargo/registry/index" \ && rm -rf "/root/.cargo/registry/cache" \ && rm -rf "/root/.cargo/git/db" -RUN cargo install cargo-dylint@2.6.0 dylint-link@2.6.0 +RUN cargo install cargo-dylint@3.1.0 dylint-link@3.1.0 RUN cargo uninstall cargo-binstall cargo-cache # install risedev diff --git a/ci/build-ci-image.sh b/ci/build-ci-image.sh index 0de8325bd188d..778c1a9f315d0 100755 --- a/ci/build-ci-image.sh +++ b/ci/build-ci-image.sh @@ -10,7 +10,7 @@ cat ../rust-toolchain # shellcheck disable=SC2155 # REMEMBER TO ALSO UPDATE ci/docker-compose.yml -export BUILD_ENV_VERSION=v20240514 +export BUILD_ENV_VERSION=v20240514-1 export BUILD_TAG="public.ecr.aws/w1p7b4n3/rw-build-env:${BUILD_ENV_VERSION}" diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index e132bbe2322f5..34d629e91cf77 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -71,7 +71,7 @@ services: retries: 5 source-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514-1 depends_on: - mysql - db @@ -84,7 +84,7 @@ services: - ..:/risingwave sink-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514-1 depends_on: - mysql - db @@ -103,12 +103,12 @@ services: rw-build-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514-1 volumes: - ..:/risingwave ci-flamegraph-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514-1 # NOTE(kwannoel): This is used in order to permit # syscalls for `nperf` (perf_event_open), # so it can do CPU profiling. @@ -119,7 +119,7 @@ services: - ..:/risingwave regress-test-env: - image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514 + image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240514-1 depends_on: db: condition: service_healthy From 3b4259dee231479a675b61435ede558c6da18b59 Mon Sep 17 00:00:00 2001 From: xxchan Date: Tue, 14 May 2024 23:46:44 +0800 Subject: [PATCH 35/39] fix lint Signed-off-by: xxchan --- src/common/src/cache.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/src/cache.rs b/src/common/src/cache.rs index 43d1932f638d1..bb4af1d615eb9 100644 --- a/src/common/src/cache.rs +++ b/src/common/src/cache.rs @@ -1031,7 +1031,6 @@ mod tests { use super::*; - #[expect(dead_code)] pub struct Block { pub offset: u64, pub sst: u64, From 9efed194c9e82cc657c33a3ba7e49eac29d2d980 Mon Sep 17 00:00:00 2001 From: xxchan Date: Wed, 15 May 2024 00:05:57 +0800 Subject: [PATCH 36/39] fix lints Signed-off-by: xxchan --- src/common/src/array/arrow/arrow_udf.rs | 3 --- src/connector/src/parser/avro/parser.rs | 4 +--- src/connector/src/parser/debezium/avro_parser.rs | 4 +--- src/connector/src/source/kinesis/source/reader.rs | 1 - src/connector/src/source/nexmark/source/reader.rs | 2 +- src/meta/src/controller/catalog.rs | 1 - src/storage/hummock_test/src/test_utils.rs | 1 + src/stream/src/common/compact_chunk.rs | 1 - src/stream/src/executor/chain.rs | 1 - src/stream/src/executor/dedup/append_only_dedup.rs | 6 +----- src/stream/src/executor/dispatch.rs | 11 +++-------- src/stream/src/executor/dml.rs | 6 +----- src/stream/src/executor/dynamic_filter.rs | 4 +--- src/stream/src/executor/filter.rs | 5 +---- src/stream/src/executor/hash_join.rs | 6 +----- src/stream/src/executor/hop_window.rs | 6 +----- src/stream/src/executor/integration_tests.rs | 8 ++------ src/stream/src/executor/join/hash_join.rs | 1 - src/stream/src/executor/lookup_union.rs | 4 +--- src/stream/src/executor/merge.rs | 7 +------ src/stream/src/executor/mview/materialize.rs | 10 ++-------- src/stream/src/executor/project.rs | 8 +++----- src/stream/src/executor/receiver.rs | 4 +--- src/stream/src/executor/row_id_gen.rs | 6 ++---- src/stream/src/executor/simple_agg.rs | 2 -- src/stream/src/executor/sink.rs | 1 - src/stream/src/executor/sort.rs | 5 +---- src/stream/src/executor/source/source_executor.rs | 7 +------ src/stream/src/executor/source/state_table_handler.rs | 6 ++---- src/stream/src/executor/stateless_simple_agg.rs | 3 --- src/stream/src/executor/top_n/group_top_n.rs | 5 +---- src/stream/src/executor/top_n/top_n_plain.rs | 6 +----- src/stream/src/executor/union.rs | 3 --- src/stream/src/executor/watermark_filter.rs | 5 +---- src/stream/src/executor/wrapper/epoch_check.rs | 2 +- src/stream/src/task/barrier_manager/tests.rs | 2 -- .../simulation/tests/integration_tests/scale/plan.rs | 1 - 37 files changed, 33 insertions(+), 125 deletions(-) diff --git a/src/common/src/array/arrow/arrow_udf.rs b/src/common/src/array/arrow/arrow_udf.rs index 5a44ef1439619..83383044f506d 100644 --- a/src/common/src/array/arrow/arrow_udf.rs +++ b/src/common/src/array/arrow/arrow_udf.rs @@ -124,11 +124,8 @@ impl FromArrow for UdfArrowConvert { #[cfg(test)] mod tests { - use std::sync::Arc; - use super::*; use crate::array::*; - use crate::buffer::Bitmap; #[test] fn struct_array() { diff --git a/src/connector/src/parser/avro/parser.rs b/src/connector/src/parser/avro/parser.rs index 9ec35a02197bf..c1950313b5e5c 100644 --- a/src/connector/src/parser/avro/parser.rs +++ b/src/connector/src/parser/avro/parser.rs @@ -197,9 +197,7 @@ mod test { use crate::connector_common::AwsAuthProps; use crate::parser::plain_parser::PlainParser; use crate::parser::unified::avro::unix_epoch_days; - use crate::parser::{ - AccessBuilderImpl, EncodingType, SourceStreamChunkBuilder, SpecificParserConfig, - }; + use crate::parser::{AccessBuilderImpl, SourceStreamChunkBuilder, SpecificParserConfig}; use crate::source::{SourceColumnDesc, SourceContext}; fn test_data_path(file_name: &str) -> String { diff --git a/src/connector/src/parser/debezium/avro_parser.rs b/src/connector/src/parser/debezium/avro_parser.rs index f74e1289bf007..3b11a1926f107 100644 --- a/src/connector/src/parser/debezium/avro_parser.rs +++ b/src/connector/src/parser/debezium/avro_parser.rs @@ -150,9 +150,7 @@ mod tests { use risingwave_pb::plan_common::{PbEncodeType, PbFormatType}; use super::*; - use crate::parser::{ - DebeziumAvroParserConfig, DebeziumParser, SourceStreamChunkBuilder, SpecificParserConfig, - }; + use crate::parser::{DebeziumParser, SourceStreamChunkBuilder, SpecificParserConfig}; use crate::source::{SourceColumnDesc, SourceContext}; const DEBEZIUM_AVRO_DATA: &[u8] = b"\x00\x00\x00\x00\x06\x00\x02\xd2\x0f\x0a\x53\x61\x6c\x6c\x79\x0c\x54\x68\x6f\x6d\x61\x73\x2a\x73\x61\x6c\x6c\x79\x2e\x74\x68\x6f\x6d\x61\x73\x40\x61\x63\x6d\x65\x2e\x63\x6f\x6d\x16\x32\x2e\x31\x2e\x32\x2e\x46\x69\x6e\x61\x6c\x0a\x6d\x79\x73\x71\x6c\x12\x64\x62\x73\x65\x72\x76\x65\x72\x31\xc0\xb4\xe8\xb7\xc9\x61\x00\x30\x66\x69\x72\x73\x74\x5f\x69\x6e\x5f\x64\x61\x74\x61\x5f\x63\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e\x12\x69\x6e\x76\x65\x6e\x74\x6f\x72\x79\x00\x02\x12\x63\x75\x73\x74\x6f\x6d\x65\x72\x73\x00\x00\x20\x6d\x79\x73\x71\x6c\x2d\x62\x69\x6e\x2e\x30\x30\x30\x30\x30\x33\x8c\x06\x00\x00\x00\x02\x72\x02\x92\xc3\xe8\xb7\xc9\x61\x00"; diff --git a/src/connector/src/source/kinesis/source/reader.rs b/src/connector/src/source/kinesis/source/reader.rs index 9a72998a341f6..4504324c5fb96 100644 --- a/src/connector/src/source/kinesis/source/reader.rs +++ b/src/connector/src/source/kinesis/source/reader.rs @@ -305,7 +305,6 @@ mod tests { use super::*; use crate::connector_common::KinesisCommon; - use crate::source::kinesis::split::KinesisSplit; use crate::source::SourceContext; #[tokio::test] diff --git a/src/connector/src/source/nexmark/source/reader.rs b/src/connector/src/source/nexmark/source/reader.rs index 6441baa154ae4..d1f10f4a00fc6 100644 --- a/src/connector/src/source/nexmark/source/reader.rs +++ b/src/connector/src/source/nexmark/source/reader.rs @@ -210,7 +210,7 @@ impl NexmarkSplitReader { #[cfg(test)] mod tests { use super::*; - use crate::source::nexmark::{NexmarkProperties, NexmarkSplitEnumerator}; + use crate::source::nexmark::NexmarkSplitEnumerator; use crate::source::{SourceContext, SourceEnumeratorContext, SplitEnumerator}; #[tokio::test] diff --git a/src/meta/src/controller/catalog.rs b/src/meta/src/controller/catalog.rs index 409672138d79f..f8ec470a74918 100644 --- a/src/meta/src/controller/catalog.rs +++ b/src/meta/src/controller/catalog.rs @@ -3008,7 +3008,6 @@ impl CatalogControllerInner { #[cfg(test)] #[cfg(not(madsim))] mod tests { - use risingwave_meta_model_v2::ViewId; use super::*; diff --git a/src/storage/hummock_test/src/test_utils.rs b/src/storage/hummock_test/src/test_utils.rs index 06a0d43ccac83..9a4e674e1f8a9 100644 --- a/src/storage/hummock_test/src/test_utils.rs +++ b/src/storage/hummock_test/src/test_utils.rs @@ -117,6 +117,7 @@ impl TestIngestBatch for S { #[cfg(test)] #[async_trait::async_trait] pub(crate) trait HummockStateStoreTestTrait: StateStore { + #[allow(dead_code)] fn get_pinned_version(&self) -> PinnedVersion; async fn seal_and_sync_epoch(&self, epoch: u64) -> StorageResult { self.seal_epoch(epoch, true); diff --git a/src/stream/src/common/compact_chunk.rs b/src/stream/src/common/compact_chunk.rs index dc5ae1561a2ba..5d6acb5125422 100644 --- a/src/stream/src/common/compact_chunk.rs +++ b/src/stream/src/common/compact_chunk.rs @@ -333,7 +333,6 @@ pub fn merge_chunk_row(stream_chunk: StreamChunk, pk_indices: &[usize]) -> Strea #[cfg(test)] mod tests { - use risingwave_common::array::StreamChunk; use risingwave_common::test_prelude::StreamChunkTestExt; use super::*; diff --git a/src/stream/src/executor/chain.rs b/src/stream/src/executor/chain.rs index ebcbe1e4e49bb..96b9422a97b2c 100644 --- a/src/stream/src/executor/chain.rs +++ b/src/stream/src/executor/chain.rs @@ -103,7 +103,6 @@ impl Execute for ChainExecutor { #[cfg(test)] mod test { - use std::default::Default; use futures::StreamExt; use risingwave_common::array::stream_chunk::StreamChunkTestExt; diff --git a/src/stream/src/executor/dedup/append_only_dedup.rs b/src/stream/src/executor/dedup/append_only_dedup.rs index f73e196815400..f98847cf1de4b 100644 --- a/src/stream/src/executor/dedup/append_only_dedup.rs +++ b/src/stream/src/executor/dedup/append_only_dedup.rs @@ -182,19 +182,15 @@ impl Execute for AppendOnlyDedupExecutor { #[cfg(test)] mod tests { use std::sync::atomic::AtomicU64; - use std::sync::Arc; - use risingwave_common::catalog::{ColumnDesc, ColumnId, Field, Schema, TableId}; + use risingwave_common::catalog::{ColumnDesc, ColumnId, Field, TableId}; use risingwave_common::test_prelude::StreamChunkTestExt; - use risingwave_common::types::DataType; use risingwave_common::util::epoch::test_epoch; use risingwave_common::util::sort_util::OrderType; use risingwave_storage::memory::MemoryStateStore; use super::*; - use crate::common::table::state_table::StateTable; use crate::executor::test_utils::MockSource; - use crate::executor::ActorContext; #[tokio::test] async fn test_dedup_executor() { diff --git a/src/stream/src/executor/dispatch.rs b/src/stream/src/executor/dispatch.rs index 6c644466f9683..9e6503c2d9a28 100644 --- a/src/stream/src/executor/dispatch.rs +++ b/src/stream/src/executor/dispatch.rs @@ -1029,26 +1029,21 @@ impl Dispatcher for SimpleDispatcher { #[cfg(test)] mod tests { use std::hash::{BuildHasher, Hasher}; - use std::sync::{Arc, Mutex}; + use std::sync::Mutex; use async_trait::async_trait; - use futures::{pin_mut, StreamExt}; - use itertools::Itertools; + use futures::pin_mut; use risingwave_common::array::stream_chunk::StreamChunkTestExt; - use risingwave_common::array::{Array, ArrayBuilder, I32ArrayBuilder, Op}; - use risingwave_common::catalog::Schema; + use risingwave_common::array::{Array, ArrayBuilder, I32ArrayBuilder}; use risingwave_common::config; - use risingwave_common::hash::VirtualNode; use risingwave_common::util::epoch::test_epoch; use risingwave_common::util::hash_util::Crc32FastBuilder; - use risingwave_common::util::iter_util::ZipEqFast; use risingwave_pb::stream_plan::DispatcherType; use super::*; use crate::executor::exchange::output::Output; use crate::executor::exchange::permit::channel_for_test; use crate::executor::receiver::ReceiverExecutor; - use crate::executor::Execute; use crate::task::test_utils::helper_make_local_actor; #[derive(Debug)] diff --git a/src/stream/src/executor/dml.rs b/src/stream/src/executor/dml.rs index b8839d76000c1..adcb3f01ab8bd 100644 --- a/src/stream/src/executor/dml.rs +++ b/src/stream/src/executor/dml.rs @@ -273,13 +273,9 @@ impl Execute for DmlExecutor { #[cfg(test)] mod tests { - use std::sync::Arc; - use risingwave_common::array::StreamChunk; - use risingwave_common::catalog::{ColumnId, Field, Schema, INITIAL_TABLE_VERSION_ID}; + use risingwave_common::catalog::{ColumnId, Field, INITIAL_TABLE_VERSION_ID}; use risingwave_common::test_prelude::StreamChunkTestExt; - use risingwave_common::transaction::transaction_id::TxnId; - use risingwave_common::types::DataType; use risingwave_common::util::epoch::test_epoch; use risingwave_dml::dml_manager::DmlManager; diff --git a/src/stream/src/executor/dynamic_filter.rs b/src/stream/src/executor/dynamic_filter.rs index eb2a0648225d3..e9c631202e8bb 100644 --- a/src/stream/src/executor/dynamic_filter.rs +++ b/src/stream/src/executor/dynamic_filter.rs @@ -488,9 +488,8 @@ impl Execute #[cfg(test)] mod tests { - use risingwave_common::array::stream_chunk::StreamChunkTestExt; use risingwave_common::array::*; - use risingwave_common::catalog::{ColumnDesc, ColumnId, Field, Schema, TableId}; + use risingwave_common::catalog::{ColumnDesc, ColumnId, Field, TableId}; use risingwave_common::util::epoch::test_epoch; use risingwave_common::util::sort_util::OrderType; use risingwave_hummock_sdk::HummockReadEpoch; @@ -499,7 +498,6 @@ mod tests { use super::*; use crate::executor::test_utils::{MessageSender, MockSource, StreamExecutorTestExt}; - use crate::executor::{ActorContext, StreamExecutorResult}; async fn create_in_memory_state_table( mem_state: MemoryStateStore, diff --git a/src/stream/src/executor/filter.rs b/src/stream/src/executor/filter.rs index 4d1ecb098bd8f..b183719a9a677 100644 --- a/src/stream/src/executor/filter.rs +++ b/src/stream/src/executor/filter.rs @@ -157,11 +157,8 @@ impl FilterExecutor { #[cfg(test)] mod tests { - use futures::StreamExt; use risingwave_common::array::stream_chunk::StreamChunkTestExt; - use risingwave_common::array::StreamChunk; - use risingwave_common::catalog::{Field, Schema}; - use risingwave_common::types::DataType; + use risingwave_common::catalog::Field; use super::super::test_utils::expr::build_from_pretty; use super::super::test_utils::MockSource; diff --git a/src/stream/src/executor/hash_join.rs b/src/stream/src/executor/hash_join.rs index a06d490400cdc..60e2e532eb1fa 100644 --- a/src/stream/src/executor/hash_join.rs +++ b/src/stream/src/executor/hash_join.rs @@ -1051,20 +1051,16 @@ impl HashJoinExecutor SortExecutor { #[cfg(test)] mod tests { use risingwave_common::array::stream_chunk::StreamChunkTestExt; - use risingwave_common::array::StreamChunk; - use risingwave_common::catalog::{ColumnDesc, ColumnId, Field, Schema, TableId}; - use risingwave_common::types::DataType; + use risingwave_common::catalog::{ColumnDesc, ColumnId, Field, TableId}; use risingwave_common::util::epoch::test_epoch; use risingwave_common::util::sort_util::OrderType; use risingwave_storage::memory::MemoryStateStore; use super::*; use crate::executor::test_utils::{MessageSender, MockSource, StreamExecutorTestExt}; - use crate::executor::{ActorContext, BoxedMessageStream, Execute}; async fn create_executor( sort_column_index: usize, diff --git a/src/stream/src/executor/source/source_executor.rs b/src/stream/src/executor/source/source_executor.rs index a793596c8ff67..a53f48827454f 100644 --- a/src/stream/src/executor/source/source_executor.rs +++ b/src/stream/src/executor/source/source_executor.rs @@ -766,15 +766,11 @@ impl WaitEpochWorker { #[cfg(test)] mod tests { use std::collections::HashSet; - use std::time::Duration; - use futures::StreamExt; use maplit::{convert_args, hashmap}; - use risingwave_common::array::StreamChunk; - use risingwave_common::catalog::{ColumnId, Field, Schema, TableId}; + use risingwave_common::catalog::{ColumnId, Field, TableId}; use risingwave_common::system_param::local_manager::LocalSystemParamsManager; use risingwave_common::test_prelude::StreamChunkTestExt; - use risingwave_common::types::DataType; use risingwave_common::util::epoch::test_epoch; use risingwave_connector::source::datagen::DatagenSplit; use risingwave_connector::source::reader::desc::test_utils::create_source_desc_builder; @@ -786,7 +782,6 @@ mod tests { use super::*; use crate::executor::source::{default_source_internal_table, SourceStateTableHandler}; - use crate::executor::ActorContext; const MOCK_SOURCE_NAME: &str = "mock_source"; diff --git a/src/stream/src/executor/source/state_table_handler.rs b/src/stream/src/executor/source/state_table_handler.rs index 7fc12000656cd..1d14de9a493c9 100644 --- a/src/stream/src/executor/source/state_table_handler.rs +++ b/src/stream/src/executor/source/state_table_handler.rs @@ -257,11 +257,9 @@ pub fn default_source_internal_table(id: u32) -> PbTable { #[cfg(test)] pub(crate) mod tests { - use std::sync::Arc; - use risingwave_common::row::OwnedRow; - use risingwave_common::types::{Datum, ScalarImpl}; - use risingwave_common::util::epoch::{test_epoch, EpochPair}; + use risingwave_common::types::Datum; + use risingwave_common::util::epoch::test_epoch; use risingwave_connector::source::kafka::KafkaSplit; use risingwave_storage::memory::MemoryStateStore; use serde_json::Value; diff --git a/src/stream/src/executor/stateless_simple_agg.rs b/src/stream/src/executor/stateless_simple_agg.rs index 1360f4166008e..dd1f39580c367 100644 --- a/src/stream/src/executor/stateless_simple_agg.rs +++ b/src/stream/src/executor/stateless_simple_agg.rs @@ -125,16 +125,13 @@ impl StatelessSimpleAggExecutor { #[cfg(test)] mod tests { use assert_matches::assert_matches; - use futures::StreamExt; use risingwave_common::array::stream_chunk::StreamChunkTestExt; - use risingwave_common::array::StreamChunk; use risingwave_common::catalog::schema_test_utils; use risingwave_common::util::epoch::test_epoch; use super::*; use crate::executor::test_utils::agg_executor::generate_agg_schema; use crate::executor::test_utils::MockSource; - use crate::executor::{Execute, StatelessSimpleAggExecutor}; #[tokio::test] async fn test_no_chunk() { diff --git a/src/stream/src/executor/top_n/group_top_n.rs b/src/stream/src/executor/top_n/group_top_n.rs index 3a8a618e3c836..d6b2af690d838 100644 --- a/src/stream/src/executor/top_n/group_top_n.rs +++ b/src/stream/src/executor/top_n/group_top_n.rs @@ -267,11 +267,9 @@ mod tests { use std::sync::atomic::AtomicU64; use assert_matches::assert_matches; - use futures::StreamExt; use risingwave_common::array::stream_chunk::StreamChunkTestExt; - use risingwave_common::catalog::{Field, Schema}; + use risingwave_common::catalog::Field; use risingwave_common::hash::SerializedKey; - use risingwave_common::types::DataType; use risingwave_common::util::epoch::test_epoch; use risingwave_common::util::sort_util::OrderType; use risingwave_storage::memory::MemoryStateStore; @@ -279,7 +277,6 @@ mod tests { use super::*; use crate::executor::test_utils::top_n_executor::create_in_memory_state_table; use crate::executor::test_utils::MockSource; - use crate::executor::{ActorContext, Barrier, Execute, Message}; fn create_schema() -> Schema { Schema { diff --git a/src/stream/src/executor/top_n/top_n_plain.rs b/src/stream/src/executor/top_n/top_n_plain.rs index 30aee860a8fc8..63b9ca94961f8 100644 --- a/src/stream/src/executor/top_n/top_n_plain.rs +++ b/src/stream/src/executor/top_n/top_n_plain.rs @@ -185,7 +185,6 @@ where #[cfg(test)] mod tests { use assert_matches::assert_matches; - use futures::StreamExt; use risingwave_common::array::stream_chunk::StreamChunkTestExt; use risingwave_common::catalog::{Field, Schema}; use risingwave_common::types::DataType; @@ -201,7 +200,7 @@ mod tests { use risingwave_common::util::epoch::test_epoch; use super::*; - use crate::executor::{ActorContext, Execute}; + fn create_stream_chunks() -> Vec { let chunk1 = StreamChunk::from_pretty( " I I @@ -685,8 +684,6 @@ mod tests { use super::*; use crate::executor::test_utils::top_n_executor::create_in_memory_state_table_from_state_store; - use crate::executor::{ActorContext, Execute}; - fn create_source_new() -> Executor { let mut chunks = vec![ StreamChunk::from_pretty( @@ -1002,7 +999,6 @@ mod tests { use super::*; use crate::executor::test_utils::top_n_executor::create_in_memory_state_table_from_state_store; - use crate::executor::{ActorContext, Execute}; fn create_source() -> Executor { let mut chunks = vec![ diff --git a/src/stream/src/executor/union.rs b/src/stream/src/executor/union.rs index ac8f3581dda18..f72f5170ce868 100644 --- a/src/stream/src/executor/union.rs +++ b/src/stream/src/executor/union.rs @@ -145,12 +145,9 @@ async fn merge(inputs: Vec) { mod tests { use async_stream::try_stream; use risingwave_common::array::stream_chunk::StreamChunkTestExt; - use risingwave_common::array::StreamChunk; - use risingwave_common::types::{DataType, ScalarImpl}; use risingwave_common::util::epoch::test_epoch; use super::*; - use crate::executor::Watermark; #[tokio::test] async fn union() { diff --git a/src/stream/src/executor/watermark_filter.rs b/src/stream/src/executor/watermark_filter.rs index c966d0411acbb..2aca1251dd058 100644 --- a/src/stream/src/executor/watermark_filter.rs +++ b/src/stream/src/executor/watermark_filter.rs @@ -349,8 +349,7 @@ impl WatermarkFilterExecutor { #[cfg(test)] mod tests { use itertools::Itertools; - use risingwave_common::array::StreamChunk; - use risingwave_common::catalog::{ColumnDesc, ColumnId, Field, Schema, TableDesc}; + use risingwave_common::catalog::{ColumnDesc, ColumnId, Field, TableDesc}; use risingwave_common::test_prelude::StreamChunkTestExt; use risingwave_common::types::Date; use risingwave_common::util::epoch::test_epoch; @@ -359,12 +358,10 @@ mod tests { use risingwave_pb::common::ColumnOrder; use risingwave_pb::plan_common::PbColumnCatalog; use risingwave_storage::memory::MemoryStateStore; - use risingwave_storage::table::TableDistribution; use super::*; use crate::executor::test_utils::expr::build_from_pretty; use crate::executor::test_utils::{MessageSender, MockSource}; - use crate::executor::{ActorContext, ExecutorInfo}; const WATERMARK_TYPE: DataType = DataType::Timestamp; diff --git a/src/stream/src/executor/wrapper/epoch_check.rs b/src/stream/src/executor/wrapper/epoch_check.rs index 0110d8a0d86e6..335c524700f01 100644 --- a/src/stream/src/executor/wrapper/epoch_check.rs +++ b/src/stream/src/executor/wrapper/epoch_check.rs @@ -75,7 +75,7 @@ pub async fn epoch_check(info: Arc, input: impl MessageStream) { #[cfg(test)] mod tests { use assert_matches::assert_matches; - use futures::{pin_mut, StreamExt}; + use futures::pin_mut; use risingwave_common::array::StreamChunk; use risingwave_common::util::epoch::test_epoch; diff --git a/src/stream/src/task/barrier_manager/tests.rs b/src/stream/src/task/barrier_manager/tests.rs index 99efb00269b8a..5fbedcdfd0dcc 100644 --- a/src/stream/src/task/barrier_manager/tests.rs +++ b/src/stream/src/task/barrier_manager/tests.rs @@ -20,10 +20,8 @@ use std::task::Poll; use assert_matches::assert_matches; use futures::future::join_all; use futures::FutureExt; -use itertools::Itertools; use risingwave_common::util::epoch::test_epoch; use risingwave_pb::stream_service::{streaming_control_stream_request, InjectBarrierRequest}; -use tokio::sync::mpsc::unbounded_channel; use tokio_stream::wrappers::UnboundedReceiverStream; use super::*; diff --git a/src/tests/simulation/tests/integration_tests/scale/plan.rs b/src/tests/simulation/tests/integration_tests/scale/plan.rs index e1d8148632c62..d39e159fc61d9 100644 --- a/src/tests/simulation/tests/integration_tests/scale/plan.rs +++ b/src/tests/simulation/tests/integration_tests/scale/plan.rs @@ -13,7 +13,6 @@ // limitations under the License. use std::collections::HashMap; -use std::default::Default; use anyhow::Result; use itertools::Itertools; From 8a9b4a8abb40417cb4111a111b988e47e0c83ccb Mon Sep 17 00:00:00 2001 From: xxchan Date: Wed, 15 May 2024 00:18:35 +0800 Subject: [PATCH 37/39] one last fix Signed-off-by: xxchan --- src/storage/src/monitor/traced_store.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/storage/src/monitor/traced_store.rs b/src/storage/src/monitor/traced_store.rs index 47c0de67729b6..df93f4c2d1a12 100644 --- a/src/storage/src/monitor/traced_store.rs +++ b/src/storage/src/monitor/traced_store.rs @@ -29,7 +29,6 @@ use crate::error::StorageResult; use crate::hummock::sstable_store::SstableStoreRef; use crate::hummock::{HummockStorage, SstableObjectIdManagerRef}; use crate::store::*; -use crate::StateStore; #[derive(Clone)] pub struct TracedStateStore { From 723e23aec64af0400046f990faeda43f0ae27c25 Mon Sep 17 00:00:00 2001 From: zwang28 <84491488@qq.com> Date: Wed, 15 May 2024 14:29:01 +0800 Subject: [PATCH 38/39] fix test --- .../simulation/tests/integration_tests/batch/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tests/simulation/tests/integration_tests/batch/mod.rs b/src/tests/simulation/tests/integration_tests/batch/mod.rs index ef530efa9f46a..616077fea0838 100644 --- a/src/tests/simulation/tests/integration_tests/batch/mod.rs +++ b/src/tests/simulation/tests/integration_tests/batch/mod.rs @@ -54,7 +54,7 @@ fn cluster_config_no_compute_nodes() -> Configuration { file.write_all( "\ [meta] -max_heartbeat_interval_secs = 60 +max_heartbeat_interval_secs = 300 [system] barrier_interval_ms = 1000 @@ -62,7 +62,10 @@ checkpoint_frequency = 1 [server] telemetry_enabled = false -metrics_level = \"Disabled\" +metrics_level = \"Disabled\"\ + +[batch] +mask_worker_temporary_secs = 30 " .as_bytes(), ) @@ -163,7 +166,7 @@ async fn test_serving_cluster_availability() { tokio::time::sleep(Duration::from_secs(15)).await; query_and_assert(session.clone()).await; // wait for mask expire - tokio::time::sleep(Duration::from_secs(30)).await; + tokio::time::sleep(Duration::from_secs(60)).await; session.run(select).await.unwrap_err(); // wait for previous nodes expire tokio::time::sleep(Duration::from_secs(300)).await; From c0df28b629e7a15fb8fcd4e4ed5f1ef23bf6ad3a Mon Sep 17 00:00:00 2001 From: Runji Wang Date: Wed, 15 May 2024 14:53:09 +0800 Subject: [PATCH 39/39] fix test Signed-off-by: Runji Wang --- src/tests/simulation/tests/integration_tests/batch/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/simulation/tests/integration_tests/batch/mod.rs b/src/tests/simulation/tests/integration_tests/batch/mod.rs index 616077fea0838..25c690cfdcbf8 100644 --- a/src/tests/simulation/tests/integration_tests/batch/mod.rs +++ b/src/tests/simulation/tests/integration_tests/batch/mod.rs @@ -62,7 +62,7 @@ checkpoint_frequency = 1 [server] telemetry_enabled = false -metrics_level = \"Disabled\"\ +metrics_level = \"Disabled\" [batch] mask_worker_temporary_secs = 30