mihaibudiu commented on code in PR #4591:
URL: https://github.com/apache/calcite/pull/4591#discussion_r2466289339
##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -3206,29 +3206,11 @@ private boolean accept_(RexNode e, List<RexNode>
newTerms) {
private boolean accept2(RexNode left, RexNode right, SqlKind kind,
List<RexNode> newTerms) {
- switch (left.getKind()) {
- case INPUT_REF:
- case FIELD_ACCESS:
- case CAST:
- switch (right.getKind()) {
- case LITERAL:
- return accept2b(left, kind, (RexLiteral) right, newTerms);
- default:
- break;
- }
- return false;
- case LITERAL:
- switch (right.getKind()) {
- case INPUT_REF:
- case FIELD_ACCESS:
- case CAST:
- return accept2b(right, kind.reverse(), (RexLiteral) left, newTerms);
- default:
- break;
- }
- return false;
- default:
- break;
+ if (right.isA(SqlKind.LITERAL) && RexUtil.isDeterministic(left)) {
Review Comment:
the point of javadoc is that you don't need to read the code, and a good IDE
will show it without needing to navigate.
##########
druid/src/test/java/org/apache/calcite/test/DruidAdapter2IT.java:
##########
@@ -3054,7 +3054,8 @@ private void testCountWithApproxDistinct(boolean approx,
String sql,
+ " CAST('1997-01-01' as DATE) GROUP BY floor(\"timestamp\" to
DAY) order by d limit 3";
final String plan = "PLAN=EnumerableInterpreter\n"
+ " DruidQuery(table=[[foodmart, foodmart]], "
- + "intervals=[[1997-01-01T00:00:00.000Z/1997-02-01T00:00:00.000Z]], "
+ + "intervals=[[1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z]], "
Review Comment:
2992 is a strange date
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]