hililiwei commented on code in PR #3991:
URL: https://github.com/apache/iceberg/pull/3991#discussion_r849341632
##########
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/IcebergTableSource.java:
##########
@@ -104,22 +105,15 @@ public void applyProjection(int[][] projectFields) {
.tableLoader(loader)
.properties(properties)
.project(getProjectedSchema())
+ .projectedFields(projectedFields)
.limit(limit)
.filters(filters)
.flinkConf(readableConfig)
.build();
}
private TableSchema getProjectedSchema() {
- if (projectedFields == null) {
- return schema;
- } else {
- String[] fullNames = schema.getFieldNames();
- DataType[] fullTypes = schema.getFieldDataTypes();
- return TableSchema.builder().fields(
- Arrays.stream(projectedFields).mapToObj(i ->
fullNames[i]).toArray(String[]::new),
- Arrays.stream(projectedFields).mapToObj(i ->
fullTypes[i]).toArray(DataType[]::new)).build();
- }
+ return projectedFields == null ? schema : projectSchema(schema,
topProjectedFields);
Review Comment:
It was revised based on the comments above. In the new version, it pushes
the projection down. top-level projected is no longer used so that additional
fields are not retrieved
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]