jonvex commented on code in PR #11770:
URL: https://github.com/apache/hudi/pull/11770#discussion_r1715649002
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/HoodieFileGroupReaderBasedParquetFileFormat.scala:
##########
@@ -108,8 +108,8 @@ class
HoodieFileGroupReaderBasedParquetFileFormat(tableState: HoodieTableState,
//dataSchema is not always right due to spark bugs
val partitionColumns = partitionSchema.fieldNames
val preCombineField =
options.getOrElse(HoodieTableConfig.PRECOMBINE_FIELD.key, "")
- val dataSchema = StructType(tableSchema.structTypeSchema.fields.filter(f
=> !partitionColumns.contains(f.name)
- || preCombineField.equals(f.name)))
+ val dataSchema = StructType(tableSchema.structTypeSchema.fields.filter(f
=> mandatoryFields.contains(f.name)
+ || !partitionColumns.contains(f.name) || preCombineField.equals(f.name)))
Review Comment:
tbh we might want to just use tableSchema.structTypeSchema instead of
computing the data schema? Are there any downsides to doing that?
--
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]