Repository navigation
GH-634: FILE: Readers must resolve the value from inline when inline and a locator are both set - #635
stefan-grafberger wants to merge 6 commits into
Conversation
rok
left a comment
There was a problem hiding this comment.
One optional nit from me. Otherwise looks good. We should get more eyes on this though!
…erenced by the locator (for ETAG, the whole file at uri), so it's also clear for ranges with offset and size
Co-authored-by: Rok Mihevc <rok@mihevc.org>
brkyvz
left a comment
There was a problem hiding this comment.
I don't know... My hope was that inline would serve as a cache for small data for sequential read use cases. I was still hoping that we could still send the file reference to a remote server for example where it can read files directly instead of having to send the bytes over the wire. This change would force us to send the bytes over the wire.
That's why we kept the definition somewhat open.
An orthogonal pain point that I was wondering if we could modify is relax the usage of "size" when there's no offset. Because on the one hand, it's nice to have it as metadata, but it can cause issues when a file gets mutated - it has the same problem with inline in that sense.
Sending |
danielcweeks
left a comment
There was a problem hiding this comment.
Many of the changes to this are not forward-compatible. We need to make sure that we do not change the requirements in incompatible ways.
| Producers are expected to write the same bytes in both, but a reader is not required | ||
| to check this and may return the bytes of either. Producers may treat `inline` and the | ||
| locator fields as mutually exclusive. | ||
| * If `inline` and a locator are both set, readers must resolve the value from `inline`. |
There was a problem hiding this comment.
If people prefer, this could also be a "should" instead of a "must", to leave room for readers that already resolve the locator, as the current spec allows:
| * If `inline` and a locator are both set, readers must resolve the value from `inline`. | |
| * If `inline` and a locator are both set, readers should resolve the value from `inline`. |
The inline field description would then change accordingly ("Readers should resolve the value from inline").
Rationale for this change
#603 allows a reader to resolve a value that sets both
inlineand a locator from either, so engines can return different bytes for the same value once the referenced data changes. The current text also expects producers to write the same bytes in both without limiting this to the time the value is written. This can be read as requiring them to keep the referenced data unchanged, which writers can't guarantee when it is outside their control, e.g., in a storage bucket managed by users rather than by the engine.What changes are included in this PR?
inlineand a locator are both set, readers must resolve the value frominline, and the locator fields record where those bytes came from. This restores the reader rule from the original FILE PR Introduces a new LogicalType: FILE #585 ("Ifinlineis set, it supplies the bytes for readers"), which Remove FILE self-references #603 changed to "a reader may resolve the value from either", while keeping Remove FILE self-references #603's clarification that both may be set.inlineto be a copy of the referenced bytes at the time the value is written, and states that producers are not required to ensure that the referenced data stays unchanged or available afterwards.No existing value becomes invalid, and for values that set both
inlineand a locator, readers may only returninline.This is an alternative to #644, which instead keeps the reader's choice and makes the result undefined if the referenced data changes. See the discussion on the mailing list: https://lists.apache.org/thread/t5n2ch4p4yx7czf7gpl909ypmdgzm3nh
Do these changes have PoC implementations?
Hardwood (hardwood#1494) already reads
inlinefirst when it is set.Closes #634