Skip to content

Commit

Permalink
fix p0 and fe ut
Browse files Browse the repository at this point in the history
  • Loading branch information
LiBinfeng-01 committed Dec 26, 2024
1 parent d7bee6b commit 08ee80d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ private static Expression processDateLikeTypeCoercion(ComparisonPredicate cp, Ex
return BooleanLiteral.FALSE;
} else if (cp instanceof GreaterThanEqual || cp instanceof LessThan) {
// '9999-12-31' + 1 will overflow
Expression tomorrow = ((DateV2Literal) right).plusDays(1);
if (tomorrow.isNullLiteral()) {
if (DateLiteral.isDateOutOfRange(((DateV2Literal) right).toJavaDateType().plusDays(1))) {
return cp;
}
right = tomorrow;
right = ((DateV2Literal) right).plusDays(1);
}
}
if (cast.child().getDataType() instanceof DateV2Type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ protected static boolean checkDate(long year, long month, long day) {
return false;
}

protected static boolean isDateOutOfRange(LocalDateTime dateTime) {
public static boolean isDateOutOfRange(LocalDateTime dateTime) {
return dateTime == null || dateTime.isBefore(START_OF_A_DAY) || dateTime.isAfter(END_OF_A_DAY);
}

Expand Down

0 comments on commit 08ee80d

Please sign in to comment.