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


##########
core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java:
##########
@@ -738,6 +740,17 @@ protected static boolean reduceExpressionsInternal(RelNode 
rel,
     // Replace predicates on CASE to CASE on predicates.
     boolean changed = new CaseShuttle().mutate(expList);
 
+    // distinct for IN rexNode
+    for (RexNode rexNode : predicates.pulledUpPredicates) {
+      if (rexNode.isA(SqlKind.IN)) {
+        RexSubQuery rexSubQuery = (RexSubQuery) rexNode;
+        List<ImmutableList<RexLiteral>> collect =
+            ((LogicalValues) rexSubQuery.rel).tuples

Review Comment:
   I aggree with you and I would add the logic for it, thanks.



##########
core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java:
##########
@@ -738,6 +740,17 @@ protected static boolean reduceExpressionsInternal(RelNode 
rel,
     // Replace predicates on CASE to CASE on predicates.
     boolean changed = new CaseShuttle().mutate(expList);
 
+    // distinct for IN rexNode
+    for (RexNode rexNode : predicates.pulledUpPredicates) {
+      if (rexNode.isA(SqlKind.IN)) {
+        RexSubQuery rexSubQuery = (RexSubQuery) rexNode;
+        List<ImmutableList<RexLiteral>> collect =
+            ((LogicalValues) rexSubQuery.rel).tuples

Review Comment:
   I aggree with you and I would add the logic for it, thanks. @mihaibudiu 



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