jnh5y commented on code in PR #28162:
URL: https://github.com/apache/flink/pull/28162#discussion_r3307144817


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/abilities/source/FilterPushDownSpec.java:
##########
@@ -160,7 +197,21 @@ static List<ResolvedExpression> resolvePredicates(
                                             "SQL expression parsing is not 
supported at this location.");
                                 })
                         .build();
-        return resolver.resolve(filters);
+        List<ResolvedExpression> resolved = resolver.resolve(filters);
+        if (resolved.size() != predicates.size()) {
+            throw new TableException(
+                    String.format(
+                            "Internal error: ExpressionResolver returned %d 
resolved expressions "
+                                    + "for %d input predicates.",
+                            resolved.size(), predicates.size()));
+        }
+        // Identity-keyed map: callers will look up resolved expressions 
returned by the source by
+        // instance equality, not by ResolvedExpression.equals (which can be 
lossy across rebuilds).
+        Map<ResolvedExpression, RexNode> reverseMap = new IdentityHashMap<>();

Review Comment:
   I tried to generate multiple predicates which were identical.  Calcite 
simplifies them.
   
   Do you have a suggested way to generate duplicate predicates?  I don't think 
this is possible.



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