Skip to content

Commit

Permalink
chore: fix typo and rebase main
Browse files Browse the repository at this point in the history
  • Loading branch information
v0y4g3r committed May 21, 2024
1 parent b9611bb commit a71c79f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
16 changes: 6 additions & 10 deletions src/mito2/src/compaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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<DfExpr> {
fn ts_to_lit(ts: Timestamp, ts_col_unit: TimeUnit) -> Result<Expr> {
let ts = ts
.convert_to(ts_col_unit)
.context(TimeRangePredicateOverflowSnafu {
Expand Down
4 changes: 2 additions & 2 deletions src/mito2/src/compaction/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<Item = &'a FileHandle>,
) -> BTreeMap<i64, Vec<FileHandle>> {
Expand Down

0 comments on commit a71c79f

Please sign in to comment.