Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Dec 5, 2023
1 parent f5e05ca commit a7ef902
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ public Expression visitEqualTo(EqualTo equalTo, CascadesContext context) {
// V1
if (equalTo.left().child(0).getDataType() instanceof DateTimeType
&& equalTo.right() instanceof DateLiteral) {
DateTimeLiteral lowerBound = ((DateLiteral) equalTo.left()).toBeginOfTheDay();
DateTimeLiteral upperBound = ((DateLiteral) equalTo.left()).toEndOfTheDay();
DateTimeLiteral lowerBound = ((DateLiteral) equalTo.right()).toBeginOfTheDay();
DateTimeLiteral upperBound = ((DateLiteral) equalTo.right()).toEndOfTheDay();
Expression newLeft = equalTo.left().child(0);
return new And(new GreaterThanEqual(newLeft, lowerBound),
new LessThanEqual(newLeft, upperBound));
}
// V2
if (equalTo.left().child(0).getDataType() instanceof DateTimeV2Type
&& equalTo.right() instanceof DateV2Literal) {
DateTimeV2Literal lowerBound = ((DateV2Literal) equalTo.left()).toBeginOfTheDay();
DateTimeV2Literal upperBound = ((DateV2Literal) equalTo.left()).toEndOfTheDay();
DateTimeV2Literal lowerBound = ((DateV2Literal) equalTo.right()).toBeginOfTheDay();
DateTimeV2Literal upperBound = ((DateV2Literal) equalTo.right()).toEndOfTheDay();
Expression newLeft = equalTo.left().child(0);
return new And(new GreaterThanEqual(newLeft, lowerBound),
new LessThanEqual(newLeft, upperBound));
Expand Down

0 comments on commit a7ef902

Please sign in to comment.