snuyanzin commented on code in PR #28162:
URL: https://github.com/apache/flink/pull/28162#discussion_r3304278843
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/abilities/source/MetadataFilterPushDownSpec.java:
##########
@@ -79,10 +81,31 @@ public List<RexNode> getPredicates() {
@Override
public void apply(DynamicTableSource tableSource, SourceAbilityContext
context) {
// Use stored predicateRowType; context's row type may be narrowed by
ProjectPushDownSpec.
- MetadataFilterResult result =
- applyMetadataFilters(predicates, predicateRowType,
tableSource, context);
- if (result.getAcceptedFilters().size() != predicates.size()) {
- throw new TableException("All metadata predicates should be
accepted here.");
+ MetadataFilterApplyResult applyResult =
+ applyMetadataFiltersWithLookup(predicates, predicateRowType,
tableSource, context);
+ // Content-based round-trip: every input predicate must come back via
the source's
+ // accepted list, identified by ResolvedExpression instance identity.
Predicates that
+ // don't round-trip indicate the source either dropped them or rebuilt
the expression
+ // (breaking the contract that the rule relied on at optimization
time).
+ Map<ResolvedExpression, RexNode> reverseMap =
applyResult.resolvedToInputRexNode;
+ IdentityHashMap<RexNode, Boolean> seen = new IdentityHashMap<>();
Review Comment:
do we need map here?
Isn't set enough?
--
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]