snuyanzin commented on code in PR #29415:
URL: https://github.com/apache/flink/pull/29415#discussion_r4206318964


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/PushProjectIntoTableSourceScanRule.java:
##########
@@ -348,7 +352,10 @@ private RowType performPushDown(
                             .map(col -> 
col.getMetadataKey().orElse(col.getName()))
                             .collect(Collectors.toList());
 
-            abilitySpecs.add(new ReadingMetadataSpec(projectedMetadataKeys, 
newProducedType));
+            // An earlier ReadingMetadataSpec must be narrowed even if no 
metadata is projected.
+            if (!projectedMetadataKeys.isEmpty() || 
hasReadingMetadataSpec(source)) {
+                abilitySpecs.add(new 
ReadingMetadataSpec(projectedMetadataKeys, newProducedType));
+            }

Review Comment:
   I hope connectors do not assume it is always present 🙈 



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