julianhyde commented on code in PR #4242:
URL: https://github.com/apache/calcite/pull/4242#discussion_r1994109835
##########
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:
I would like to see a test case where the values are not sorted. `in (2, 1,
2, 3)` should become `in (2, 1, 3)`. This ensures stability.
--
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]