HairstonE opened a new pull request, #27934:
URL: https://github.com/apache/datafusion/pull/27934

   ## Which issue does this PR close?
   
   - Closes #18211.
   
   ## Rationale for this change
   
   If a file is overwritten between planning and execution, the scan reads the 
new bytes through byte ranges computed from the old file. The reads fail or 
return wrong rows. The planning-time etag and version already sit in 
`PartitionedFile::object_meta`.
   
   ## What changes are included in this PR?
   
   An opt-in `object_version_type` (`ETag` or `Version`) on `ListingOptions`. 
At open time, each file's store is wrapped so that every read carries the 
planning-time etag or version in `GetOptions`. The store then rejects an 
overwritten file with a precondition error instead of serving mismatched bytes. 
With `Version`, a versioned store serves the planning-time object instead. 
Pinned plans refuse proto serialization until the `PartitionedFile` proto 
carries the pinned fields.
   
   ## What is the testing strategy for this PR?
   
   Integration tests in `object_version_pinning.rs` run across parquet, CSV, 
and JSON through a request-recording store. They assert that every read carries 
the pin, that a same-size overwrite fails only when pinned, and that a missing 
version id fails at open. Unit tests cover the off switch and the 
missing-metadata errors.
   
   ## Are there any user-facing changes?
   
   New opt-in API on `ListingOptions` and `FileScanConfigBuilder`. Defaults are 
unchanged. The new public struct fields can break struct-literal construction 
downstream.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to