chunweilei commented on a change in pull request #2105:
URL: https://github.com/apache/calcite/pull/2105#discussion_r469027988
##########
File path: core/src/test/java/org/apache/calcite/rex/RexProgramBuilderBase.java
##########
@@ -306,6 +306,14 @@ protected RexNode gt(RexNode n1, RexNode n2) {
return rexBuilder.makeCall(SqlStdOperatorTable.GREATER_THAN, n1, n2);
}
+ protected RexNode like(RexNode ref, RexNode pattern) {
+ return rexBuilder.makeCall(SqlStdOperatorTable.LIKE, ref, pattern);
+ }
+
+ protected RexNode like(RexNode ref, RexNode pattern, RexNode escape) {
+ return rexBuilder.makeCall(SqlStdOperatorTable.LIKE, ref, pattern, escape);
+ }
+
Review comment:
What does this method mean? Could you add some comments?
##########
File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
##########
@@ -2284,6 +2291,12 @@ static Predicate of(RexNode t) {
}
return IsPredicate.of(t);
}
+
+ /** Returns whether this predicate can while simplifying other OR
+ * operands. */
+ default boolean allowedInOr(RelOptPredicateList predicates) {
+ return true;
Review comment:
It seems to lack some words between `can` and `while`.
##########
File path:
core/src/test/resources/org/apache/calcite/test/SqlToRelConverterTest.xml
##########
@@ -3763,7 +3765,7 @@ LogicalProject(DEPTNO=[$7])
</TestCase>
<TestCase name="testReduceConstExpr">
<Resource name="sql">
- <![CDATA[select sum(case when 'y' = 'n' then ename else 1 end)
from emp]]>
+ <![CDATA[select sum(case when 'y' = 'n' then ename else 0.1 end)
from emp]]>
</Resource>
Review comment:
Is this change correct?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]