yihua commented on code in PR #17536:
URL: https://github.com/apache/hudi/pull/17536#discussion_r2613078152
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/HoodieFileGroupReaderBasedFileFormat.scala:
##########
@@ -260,8 +261,8 @@ class HoodieFileGroupReaderBasedFileFormat(tablePath:
String,
.withHoodieTableMetaClient(metaClient)
.withLatestCommitTime(queryTimestamp)
.withFileSlice(fileSlice)
- .withDataSchema(dataAvroSchema)
- .withRequestedSchema(requestedAvroSchema)
+ .withDataSchema(HoodieSchema.fromAvroSchema(dataAvroSchema))
+
.withRequestedSchema(HoodieSchema.fromAvroSchema(requestedAvroSchema))
Review Comment:
Could the Avro schema conversion be removed in a separate PR so the
StructType schema is directly converted to `HoodieSchema`?
```
val requestedSchema = StructType(requiredSchema.fields ++
partitionSchema.fields.filter(f => mandatoryFields.contains(f.name)))
val requestedAvroSchema =
AvroSchemaUtils.pruneDataSchema(avroTableSchema,
AvroConversionUtils.convertStructTypeToAvroSchema(requestedSchema,
sanitizedTableName), exclusionFields)
val dataAvroSchema = AvroSchemaUtils.pruneDataSchema(avroTableSchema,
AvroConversionUtils.convertStructTypeToAvroSchema(dataSchema,
sanitizedTableName), exclusionFields)
```
--
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]