Skip to content

Commit

Permalink
fix: find time range for projection (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 authored Nov 29, 2023
1 parent 239265c commit a905863
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ impl TreeNodeVisitor for TimeRangeVisitor {

fn pre_visit(&mut self, plan: &LogicalPlan) -> Result<VisitRecursion> {
match plan {
LogicalPlan::Projection(p) => {
let idx = p.schema.index_of_column(&self.col)?;
match unwrap_alias(&p.expr[idx]) {
Expr::Column(ref c) => {
self.col = c.clone();
Ok(VisitRecursion::Continue)
}
_ => Ok(VisitRecursion::Stop),
}
}
LogicalPlan::Filter(f) => {
let range = self.range.clone();
let range = split_conjunction(&f.predicate)
Expand All @@ -67,6 +57,7 @@ impl TreeNodeVisitor for TimeRangeVisitor {
}
// These nodes do not alter their schema, so we can recurse through them
LogicalPlan::Sort(_)
| LogicalPlan::Projection(_)
| LogicalPlan::Repartition(_)
| LogicalPlan::Limit(_)
| LogicalPlan::Explain(_)
Expand Down

0 comments on commit a905863

Please sign in to comment.