godfreyhe commented on a change in pull request #13631:
URL: https://github.com/apache/flink/pull/13631#discussion_r514907339



##########
File path: 
flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/rules/logical/PushProjectIntoTableSourceScanRule.java
##########
@@ -207,27 +208,35 @@ private DataType applyUpdateMetadataAndGetNewDataType(
                                .filter(usedMetadataKeysUnordered::contains)
                                .collect(Collectors.toList());
 
-               final List<List<Integer>> projectedMetadataFields = 
usedMetadataKeys
-                               .stream()
-                               .map(metadataKeys::indexOf)
-                               .map(i -> {
-                                       
fieldCoordinatesToOrder.put(physicalFieldCount + i, 
Collections.singletonMap(Collections.singletonList("*"), 
fieldCoordinatesToOrder.size()));
-                                       return 
Collections.singletonList(physicalFieldCount + i); })
-                               .collect(Collectors.toList());
+               final List<List<Integer>> projectedMetadataFields = new 
ArrayList<>(usedMetadataKeys.size());

Review comment:
       This line is unnecessary, use 
`usedFieldsCoordinates.add(Collections.singletonList(physicalFieldCount + 
index))` at line 217




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to