voonhous commented on code in PR #19926:
URL: https://github.com/apache/hudi/pull/19926#discussion_r4615569013
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/common/util/ParquetUtils.java:
##########
@@ -452,10 +452,27 @@ public HoodieFileFormat getFormat() {
*/
@Override
public List<GenericRecord> readAvroRecords(HoodieStorage storage,
StoragePath filePath) {
+ // A schema-less read takes the schema from the file; the copy drops any
read schema or
+ // projection a previous caller left on the shared configuration.
+ Configuration conf = storage.getConf().unwrapCopyAs(Configuration.class);
Review Comment:
Added `TestParquetUtils#testReadAvroRecordsLeavesCallerConfUntouched`. It
reads one file twice through the same `HoodieStorage`:
- a read with an evolved schema (one extra nullable field) returns
three-field records and leaves `parquet.avro.read.schema` unset on the caller's
conf;
- after a key-only read schema and requested projection are planted on that
conf, a schema-less read still returns both file fields, and the planted values
are left as they were.
Each half fails on the previous `readAvroRecords`.
--
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]