voonhous opened a new pull request, #20891:
URL: https://github.com/apache/hudi/pull/20891

   ### Describe the issue this Pull Request addresses
   
   `HDFSParquetImporterUtils#buildHoodieRecordsForImport` sets the Avro read 
schema on `jsc.hadoopConfiguration()` after `Job.getInstance` has already 
copied that conf, so the importer's read (which uses `job.getConfiguration()`) 
never sees the schema, and the schema stays on the shared Spark Hadoop conf for 
every later reader in the JVM. Raised in 
https://github.com/apache/hudi/pull/19927#discussion_r4147639777; #19926 
already guards `ParquetUtils#readAvroRecords` against such a leftover by 
reading on a copy.
   
   ### Summary and Changelog
   
   The importer now reads its source files with the supplied schema, and no 
longer leaves `parquet.avro.read.schema` on the shared conf.
   
   - `HDFSParquetImporterUtils`: set the read schema on 
`job.getConfiguration()`.
   - `TestHdfsParquetImportProcedure`: new test that imports with a schema 
dropping one column, asserts the records lack it, and asserts the shared conf 
has no read schema afterwards.
   
   ### Impact
   
   `hdfs_parquet_import` now applies the supplied schema when reading the 
source Parquet files, instead of each file's own schema. A source file missing 
a field the schema requires without a default now fails at read time.
   
   ### Risk Level
   
   low. The importer already wrote with the supplied schema; only the read now 
matches it.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


-- 
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]

Reply via email to