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

   ### Describe the issue this Pull Request addresses
   
   closes #19745
   
   ### Summary and Changelog
   
   `SparkSampleWritesUtils.doSampleWrites` initialized the sample-writes shadow 
table without a table version, so it defaulted to 
`HoodieTableVersion.current()` even when the inherited write config carried a 
different `hoodie.write.table.version` (for example `6`). The shadow table 
layout then mismatched the `SparkRDDWriteClient` operating on it, which can 
surface as version-conditional failures during the sample write.
   
   This routes the configured write version into both the shadow table and the 
sample-writes write config:
   - `newTableBuilder().setTableVersion(writeConfig.getWriteVersion())` so the 
on-disk table matches the configured version.
   - `HoodieWriteConfig.Builder.withWriteTableVersion(...)` so the client is 
anchored to that same version.
   
   `TestSparkSampleWritesUtils.overwriteRecordSizeEstimateForEmptyTable` is 
parameterized across table versions `{SIX, NINE}` to exercise both paths.
   
   ### Impact
   
   No public API change. Sample-writes-based record-size estimation now works 
when the table is written at a non-current table version.
   
   ### Risk Level
   
   low. Covered by the parameterized unit test; the change only sets the 
version already present in the write config.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Enough context is provided in the sections above
   - [ ] 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