Skip to content

Commit

Permalink
[Feat](nereids) Support date_trunc function in partition prune (#38025)
Browse files Browse the repository at this point in the history
let range partition pruner support date_trunc(dt, 'day') > 10.
For example, partition column is dt, 
there is a partition
('2020-01-01 10:00:00', '2020-02-05 10:00:00'),
and a predicate
date_trunc(dt, 'day')<'2019-01-01 ',
this partition can be pruned.
  • Loading branch information
feiniaofeiafei authored Aug 1, 2024
1 parent 1eff4e1 commit 7061ae2
Show file tree
Hide file tree
Showing 6 changed files with 560 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,12 @@ public static ColumnRange between(Literal lower, Literal upper) {
public static ColumnRange range(Literal lower, BoundType lowerType, Literal upper, BoundType upperType) {
return new ColumnRange(ColumnBound.range(lower, lowerType, upper, upperType));
}

public ColumnRange withLowerBound(Literal lower) {
return this.intersect(atLeast(lower));
}

public ColumnRange withUpperBound(Literal upper) {
return this.intersect(atMost(upper));
}
}
Loading

0 comments on commit 7061ae2

Please sign in to comment.