Skip to content

Commit

Permalink
fix: resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
v0y4g3r committed May 21, 2024
1 parent f7da388 commit 6defa14
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/table/src/predicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ pub fn build_time_range_predicate<'a>(
let mut res = TimestampRange::min_to_max();
let mut filters_remain = vec![];
for expr in std::mem::take(filters) {
if let Some(range) = extract_time_range_from_expr(ts_col_name, ts_col_unit, expr.df_expr())
{
if let Some(range) = extract_time_range_from_expr(ts_col_name, ts_col_unit, &expr) {
res = res.and(&range);
} else {
filters_remain.push(expr);
Expand Down Expand Up @@ -283,11 +282,7 @@ fn extract_from_binary_expr(
}
}

fn get_timestamp_filter(
ts_col_name: &str,
left: &Expr,
right: &Expr,
) -> Option<(Timestamp, bool)> {
fn get_timestamp_filter(ts_col_name: &str, left: &Expr, right: &Expr) -> Option<(Timestamp, bool)> {
let (col, lit, reverse) = match (left, right) {
(Expr::Column(column), Expr::Literal(scalar)) => (column, scalar, false),
(Expr::Literal(scalar), Expr::Column(column)) => (column, scalar, true),
Expand Down Expand Up @@ -394,7 +389,7 @@ mod tests {
fn check_build_predicate(expr: Expr, expect: TimestampRange) {
assert_eq!(
expect,
build_time_range_predicate("ts", TimeUnit::Millisecond, &mut vec![Expr::from(expr)])
build_time_range_predicate("ts", TimeUnit::Millisecond, &mut vec![expr])
);
}

Expand Down

0 comments on commit 6defa14

Please sign in to comment.