asolimando commented on code in PR #4371:
URL: https://github.com/apache/calcite/pull/4371#discussion_r2086650109
##########
core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java:
##########
@@ -354,6 +354,32 @@ private static boolean skipItem(RexNode expr) {
.check();
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6887">[CALCITE-6887]
+ * ReduceExpressionsRule applied to 'IN subquery' should make the values
distinct
+ * if the subquery is a constant Values</a>. */
+ @Test void testReduceInValues() {
+ final String sql = "SELECT deptno, sal "
+ + "FROM EMP "
+ + "WHERE deptno IN (1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)";
Review Comment:
I'd make the test simpler (no need for that many ending `1`s, a couple
suffice) and add more tests around edge cases (rule is no-op if no duplicates,
multiple duplicate values, nulls, data types, etc.).
Does the approach also handle complex data types in its current
implementation? If not, should it support them?
--
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]