diff --git a/src/mito2/src/compaction.rs b/src/mito2/src/compaction.rs index baae619cabf2..b41f7319496f 100644 --- a/src/mito2/src/compaction.rs +++ b/src/mito2/src/compaction.rs @@ -17,12 +17,12 @@ use std::sync::Arc; use std::time::{Duration, Instant}; use api::v1::region::compact_request; -use common_query::logical_plan::DfExpr; use common_telemetry::{debug, error}; use common_time::range::TimestampRange; use common_time::timestamp::TimeUnit; use common_time::Timestamp; use datafusion_common::ScalarValue; +use datafusion_expr::Expr; pub use picker::CompactionPickerRef; use snafu::{OptionExt, ResultExt}; use store_api::metadata::RegionMetadataRef; @@ -468,23 +468,19 @@ fn time_range_to_predicate( (Some(start), Some(end)) => { vec![ datafusion_expr::col(ts_col.column_schema.name.clone()) - .gt_eq(ts_to_lit(*start, ts_col_unit)?) - .into(), + .gt_eq(ts_to_lit(*start, ts_col_unit)?), datafusion_expr::col(ts_col.column_schema.name.clone()) - .lt(ts_to_lit(*end, ts_col_unit)?) - .into(), + .lt(ts_to_lit(*end, ts_col_unit)?), ] } (Some(start), None) => { vec![datafusion_expr::col(ts_col.column_schema.name.clone()) - .gt_eq(ts_to_lit(*start, ts_col_unit)?) - .into()] + .gt_eq(ts_to_lit(*start, ts_col_unit)?)] } (None, Some(end)) => { vec![datafusion_expr::col(ts_col.column_schema.name.clone()) - .lt(ts_to_lit(*end, ts_col_unit)?) - .into()] + .lt(ts_to_lit(*end, ts_col_unit)?)] } (None, None) => { return Ok(None); @@ -493,7 +489,7 @@ fn time_range_to_predicate( Ok(Some(Predicate::new(exprs))) } -fn ts_to_lit(ts: Timestamp, ts_col_unit: TimeUnit) -> Result { +fn ts_to_lit(ts: Timestamp, ts_col_unit: TimeUnit) -> Result { let ts = ts .convert_to(ts_col_unit) .context(TimeRangePredicateOverflowSnafu { diff --git a/src/mito2/src/compaction/window.rs b/src/mito2/src/compaction/window.rs index 4ded42220a28..ccd1203a6beb 100644 --- a/src/mito2/src/compaction/window.rs +++ b/src/mito2/src/compaction/window.rs @@ -87,7 +87,7 @@ impl WindowedCompactionPicker { expired_ssts.iter().for_each(|f| f.set_compacting(true)); } - let windows = asign_files_to_time_windows( + let windows = assign_files_to_time_windows( time_window, current_version .ssts @@ -179,7 +179,7 @@ fn build_output( /// Assigns files to time windows. If file does not contain a time range in metadata, it will be /// assigned to a special bucket `i64::MAX` (normally no timestamp can be aligned to this bucket) /// so that all files without timestamp can be compacted together. -fn asign_files_to_time_windows<'a>( +fn assign_files_to_time_windows<'a>( bucket_sec: i64, files: impl Iterator, ) -> BTreeMap> {