dramaticlly commented on code in PR #10547:
URL: https://github.com/apache/iceberg/pull/10547#discussion_r1663244200
##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java:
##########
@@ -375,30 +374,33 @@ private Schema schemaWithMetadataColumns() {
.distinct()
.map(name -> MetadataColumns.metadataColumn(table, name))
.collect(Collectors.toList());
- // only calculate potential column id collision if _partition was requested
- Schema metadataSchema =
- metadataFields.isEmpty() ||
!metaColumns.contains(MetadataColumns.PARTITION_COLUMN_NAME)
- ? new Schema(metadataFields)
- : deduplicateSchemaIds(metadataFields);
+ Schema metadataSchema = calculateMetadataSchema(metadataFields);
// schema or rows returned by readers
return TypeUtil.join(schema, metadataSchema);
}
- private Schema deduplicateSchemaIds(List<Types.NestedField>
metaColumnFields) {
- Map<Integer, Types.NestedField> indexedMetadataColumnFields =
- TypeUtil.indexById(Types.StructType.of(metaColumnFields));
+ private Schema calculateMetadataSchema(List<Types.NestedField>
metaColumnFields) {
+ // only calculate potential column id collision if _partition was requested
+ boolean requireDeduplicateSchemaIds =
Review Comment:
sounds good!
--
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]