yihua commented on code in PR #12979:
URL: https://github.com/apache/hudi/pull/12979#discussion_r1999364838
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/HoodieFileGroupReaderBasedParquetFileFormat.scala:
##########
@@ -145,7 +150,7 @@ class
HoodieFileGroupReaderBasedParquetFileFormat(tableState: HoodieTableState,
val fixedPartitionIndexes = fixedPartitionIndexesArr.toSet
// schema that we want fg reader to output to us
- val requestedSchema = StructType(requiredSchema.fields ++
partitionSchema.fields.filter(f => mandatoryFields.contains(f.name)))
+ val requestedSchema = getRequestedSchema(options, dataSchema,
partitionSchema, requiredSchema, mandatoryFields)
Review Comment:
`HoodieFileGroupReaderSchemaHandler#generateRequiredSchema` has the logic to
append all necessary fields for merging in MOR which is independent of engines.
Could you check why that's not applied for the bug you discovered?
Also, could we avoid such logic of appending all necessary fields for
merging at the Spark layer if possible, to reduce the complexity in this class?
--
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]