Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
yujun777 committed Nov 28, 2024
1 parent f35ba0b commit 67fd0d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,14 @@ private static Expression processTypeRangeLimitComparison(ComparisonPredicate cp
}
} else if (cp instanceof GreaterThan) {
if (cmpMin < 0) {
return ExpressionUtils.trueOfNull(left);
return ExpressionUtils.trueOrNull(left);
}
if (cmpMax >= 0) {
return ExpressionUtils.falseOrNull(left);
}
} else if (cp instanceof GreaterThanEqual) {
if (cmpMin <= 0) {
return ExpressionUtils.trueOfNull(left);
return ExpressionUtils.trueOrNull(left);
}
if (cmpMax == 0) {
return new EqualTo(cp.left(), cp.right());
Expand All @@ -361,7 +361,7 @@ private static Expression processTypeRangeLimitComparison(ComparisonPredicate cp
return ExpressionUtils.falseOrNull(left);
}
if (cmpMax > 0) {
return ExpressionUtils.trueOfNull(left);
return ExpressionUtils.trueOrNull(left);
}
} else if (cp instanceof LessThanEqual) {
if (cmpMin < 0) {
Expand All @@ -371,7 +371,7 @@ private static Expression processTypeRangeLimitComparison(ComparisonPredicate cp
return new EqualTo(cp.left(), cp.right());
}
if (cmpMax >= 0) {
return ExpressionUtils.trueOfNull(left);
return ExpressionUtils.trueOrNull(left);
}
}
return cp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public static Expression falseOrNull(Expression expression) {
}
}

public static Expression trueOfNull(Expression expression) {
public static Expression trueOrNull(Expression expression) {
if (expression.nullable()) {
return new Or(new Not(new IsNull(expression)), new NullLiteral(BooleanType.INSTANCE));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ void checkTypeRangeLimitWithComparison(DataType dataType, ComparisonPredicate cp
switch (result) {
case TRUE:
expectExpr = cp instanceof NullSafeEqual ? BooleanLiteral.TRUE
: ExpressionUtils.trueOfNull(slot);
: ExpressionUtils.trueOrNull(slot);
break;
case FALSE:
expectExpr = cp instanceof NullSafeEqual ? BooleanLiteral.FALSE
Expand Down

0 comments on commit 67fd0d5

Please sign in to comment.