xuzifu666 commented on code in PR #4242:
URL: https://github.com/apache/calcite/pull/4242#discussion_r1994576559


##########
core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java:
##########
@@ -347,6 +347,18 @@ private static boolean skipItem(RexNode expr) {
         .check();
   }
 
+  /**
+   * Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-6887";>[CALCITE-6887]
+   * In should distinct values with ReduceExpressionRule</a>. */
+  @Test void testReduceExpressionsWithIn() {
+    final String sql = "select deptno, sal "
+        + "from emp "
+        + "where deptno in (1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1) ";
+    sql(sql).withRule(CoreRules.PROJECT_REDUCE_EXPRESSIONS)

Review Comment:
   Yes, this is work well because values number in IN lower than 20, would 
transform to OR with multiple EQUAL and distinct the values. so I did not add 
case about with test it local. @julianhyde 



-- 
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]

Reply via email to