-
Notifications
You must be signed in to change notification settings - Fork 500
Specify storage inheritance for FILE self-references #603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
53dc52b
7b729c6
f5eb885
86479df
3047a52
81f61ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -688,11 +688,11 @@ external reference (`uri` set). `offset` must not be < 0. | |
|
|
||
| ##### size | ||
|
|
||
| The byte length of the referenced data. Must be zero or a positive integer if set; a | ||
| value of 0 indicates empty referenced data. `size` must be set whenever `offset` is set. | ||
| It may be omitted only for a whole-file external reference (`uri` set, `offset` not set), | ||
| in which case the range runs to the end of the referenced file. Because a self-reference | ||
| always sets `offset`, it always sets `size` as well. | ||
| The byte length of the stored representation. Must be zero or a positive integer if set. | ||
| A value of 0 indicates an empty stored representation. `size` must be set whenever | ||
| `offset` is set. It may be omitted only for a whole-file external reference (`uri` set, | ||
| `offset` not set), in which case the range runs to the end of the referenced file. | ||
| Because a self-reference always sets `offset`, it always sets `size` as well. | ||
|
|
||
| ##### content_type | ||
|
|
||
|
|
@@ -735,17 +735,17 @@ only. | |
| A value resolves to bytes based on which of `inline`, `uri`, `offset`, and `size` are | ||
| set: | ||
|
|
||
| | `inline` | `uri` | `offset` | `size` | Resolves to | | ||
| |----------|-------|----------|--------|-------------------------------------------------------| | ||
| | set | - | - | - | the inline bytes | | ||
| | - | set | - | - | whole external file at `uri` | | ||
| | - | set | set | - | invalid | | ||
| | - | set | - | set | external `uri`, `[0, size)` | | ||
| | - | set | set | set | external `uri`, `[offset, offset + size)` | | ||
| | - | - | set | - | invalid | | ||
| | - | - | - | set | invalid | | ||
| | - | - | set | set | this file, `[offset, offset + size)` (self-reference) | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mind updating the spaces for the other lines so that the table is aligned?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed—the table is aligned now. Thanks! |
||
| | - | - | - | - | nothing - invalid | | ||
| | `inline` | `uri` | `offset` | `size` | Resolves to | | ||
| |----------|-------|----------|--------|-----------------------------------------------------------------------| | ||
| | set | - | - | - | the inline bytes | | ||
| | - | set | - | - | whole external file at `uri` | | ||
| | - | set | set | - | invalid | | ||
| | - | set | - | set | external `uri`, `[0, size)` | | ||
| | - | set | set | set | external `uri`, `[offset, offset + size)` | | ||
| | - | - | set | - | invalid | | ||
| | - | - | - | set | invalid | | ||
| | - | - | set | set | stored bytes in this file, `[offset, offset + size)` (self-reference) | | ||
| | - | - | - | - | nothing - invalid | | ||
|
|
||
| `size` must be set whenever `offset` is set, so any offset-based read always carries an | ||
| explicit `size`. A self-reference (`uri` not set) must set `offset`, and therefore also | ||
|
|
@@ -756,10 +756,44 @@ A self-reference points within the same Parquet file using `offset` and `size` ( | |
| required). A self-reference is when `uri` is not set. A file containing self-references | ||
| can be renamed or relocated as a single unit. | ||
|
|
||
| Parquet files containing self-references must not use Parquet modular encryption. | ||
| Self-referenced byte ranges are not Parquet encryption modules and therefore cannot | ||
| be encrypted or authenticated independently. Encryption of external files referenced | ||
| by `uri` is outside the scope of the Parquet format. | ||
| A schema that permits self-references must include the `inline` field. | ||
|
|
||
| Each self-reference inherits the compression and encryption settings of the `inline` | ||
| column chunk in the same row group. The corresponding position is the position | ||
| representing the same `FILE` value in the `inline` column's repetition and definition | ||
| level stream. | ||
|
|
||
| Each referenced byte range is compressed independently using the `CompressionCodec` | ||
| of the `inline` column chunk. `UNCOMPRESSED` leaves the referenced bytes uncompressed. | ||
|
|
||
| Each compressed byte range is an independent compression block. Compression state is | ||
| not shared with the data page or with other referenced ranges. | ||
|
|
||
| For an unencrypted self-reference, `offset` and `size` identify either the independent | ||
| compressed block or the uncompressed bytes. For a compressed block, the complete range | ||
| is supplied to the codec, and its decompressed output is the resolved value. | ||
|
Comment on lines
+773
to
+774
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also store the decompressed size somewhere? |
||
|
|
||
| The encryption state and key are inherited from the `inline` column chunk. If the | ||
| column chunk is encrypted, each self-reference is encrypted independently using the | ||
| same column key and file encryption algorithm. Compression is applied before | ||
| encryption. If the column chunk is not encrypted, its self-references are not | ||
| encrypted. See [Parquet Modular Encryption](Encryption.md) for the encryption layout | ||
| and AAD construction. | ||
|
|
||
| A self-reference identifies a stored representation, not necessarily the resolved | ||
| bytes. Consumers must use a Parquet reader to resolve a self-reference; copying | ||
| `[offset, offset + size)` directly may return compressed or encrypted data. To resolve | ||
| a self-reference, a reader: | ||
|
|
||
| 1. reads the stored representation identified by `offset` and `size`; | ||
| 2. decrypts it when the corresponding `inline` column chunk is encrypted; | ||
| 3. decompresses it using the `CompressionCodec` of the corresponding `inline` column | ||
| chunk, unless the codec is `UNCOMPRESSED`; | ||
| 4. returns the resulting bytes. | ||
|
|
||
| `content_type` and `checksum` describe the resolved bytes after these transformations. | ||
| These compression and encryption rules do not apply to external references. Encryption | ||
| of external files referenced by `uri` is outside the scope of the Parquet format. | ||
|
|
||
| #### Validation | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4-byte length limits us to 2GiB payload. Are we expecting use cases with greater size requirements?