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


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/rules/logical/MetadataFilterResultShapesITCase.java:
##########
@@ -302,4 +375,64 @@ public ScanRuntimeProvider 
getScanRuntimeProvider(ScanContext runtimeProviderCon
             return SourceProvider.of(source);
         }
     }
+
+    /**
+     * Source that supports both physical and metadata filter push-down. 
Accepts all filters it
+     * receives, emits all rows (runtime Calc is the load-bearing filter for 
remaining predicates).
+     */
+    static class MixedFilterTrackingSource extends 
TableFactoryHarness.ScanSourceBase
+            implements SupportsReadingMetadata, SupportsFilterPushDown {
+
+        private DataType producedDataType;
+        private List<ResolvedExpression> acceptedPhysicalFilters = new 
ArrayList<>();
+
+        MixedFilterTrackingSource() {
+            super(true);
+        }
+
+        @Override
+        public Map<String, DataType> listReadableMetadata() {
+            Map<String, DataType> metadata = new LinkedHashMap<>();
+            metadata.put("m0", INT());
+            metadata.put("m1", INT());
+            return metadata;
+        }
+
+        @Override
+        public void applyReadableMetadata(List<String> metadataKeys, DataType 
producedDataType) {
+            this.producedDataType = producedDataType;
+        }
+
+        @Override
+        public boolean supportsMetadataFilterPushDown() {
+            return true;
+        }
+
+        @Override
+        public MetadataFilterResult 
applyMetadataFilters(List<ResolvedExpression> metadataFilters) {
+            return MetadataFilterResult.of(metadataFilters, 
Collections.emptyList());
+        }
+
+        @Override
+        public Result applyFilters(List<ResolvedExpression> filters) {
+            acceptedPhysicalFilters.addAll(filters);
+            return Result.of(Collections.emptyList(), filters);
+        }

Review Comment:
   Good catch.  Applied in a force push!



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