forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 18
Iceberg deletion vector support #2119
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
Open
ianton-ru
wants to merge
24
commits into
antalya-26.6
Choose a base branch
from
feature/antalya-26.6/iceberg-puffin-deletion-vectors-read
base: antalya-26.6
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
5bd1ca3
Iceberg deletion vector
ianton-ru e02f379
Fix count-from-files cache guard polarity for `_headers`.
ianton-ru ece3851
Add required sidebar frontmatter to Puffin format docs.
ianton-ru 8307902
Guard IcebergDeletionVector.cpp with USE_AVRO.
ianton-ru 4b30a8f
Fix settings history
ianton-ru 889f10c
Add integration test for aggregates over Iceberg deletion vectors.
ianton-ru 7b5537e
Validate CRoaring bitmaps after portable deserialize for Puffin DVs.
ianton-ru 1138759
Share Puffin deletion-vector deserialize helpers between Iceberg and …
ianton-ru 8dc472c
Bind Iceberg deletion vectors against the Puffin footer.
ianton-ru d6cf520
Reject Iceberg DV positions outside the data file record_count.
ianton-ru 0d4ed43
Include DV cardinality and data-file row count in Puffin cache keys.
ianton-ru dca3390
Estimate roaring heap footprint for Puffin files cache weight.
ianton-ru c0bcf5f
Reject overflowing Parquet row-group global offsets.
ianton-ru 856f4d2
Count Puffin cache loads discarded by clear as misses.
ianton-ru 35afbcd
Accept spaced SYSTEM DROP PUFFIN FILES CACHE alias.
ianton-ru 6fa9031
Use a temporary file in Parquet need-only-count gtest.
ianton-ru 22c920e
Require direct referenced_data_file for Puffin deletion vectors.
ianton-ru ba8ecd7
Count clear-discarded Puffin cache waiters as misses.
ianton-ru 8e34c4b
Avoid O(file rows) Filter for need-only-count with DVs.
ianton-ru 72571a4
Fail closed trivial COUNT when DVs coexist with position deletes.
ianton-ru f18dfd1
Fail closed snapshot COUNT when position deletes exceed rows.
ianton-ru 4d2f56f
Use roaring rank for DV need-only-count range cardinality.
ianton-ru 93b9086
Update PuffinFilesRead expectations after footer bind.
ianton-ru 2d83622
Merge branch 'antalya-26.6' into feature/antalya-26.6/iceberg-puffin-…
ianton-ru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| description: 'Documentation for the Puffin format' | ||
| input_format: true | ||
| output_format: false | ||
| keywords: ['Puffin'] | ||
| sidebar_label: 'Puffin' | ||
| sidebar_position: 1 | ||
| slug: /interfaces/formats/Puffin | ||
| title: 'Puffin' | ||
| doc_type: 'reference' | ||
| --- | ||
|
|
||
| ## Description {#description} | ||
|
|
||
| Input format for reading [Apache Iceberg Puffin](https://iceberg.apache.org/puffin-spec/) files. | ||
|
|
||
| The format exposes deleted row positions from `deletion-vector-v1` blobs. Other blob types (for example `apache-datasketches-theta-v1`) are skipped. | ||
| If a puffin file contains multiple `deletion-vector-v1` blobs, the format outputs one row per such blob. | ||
|
|
||
| Fixed output columns: | ||
| - `referenced_data_file` (`String`) - location of the data file the deletion vector applies to (`referenced-data-file` blob property) | ||
| - `deleted_rows` (`Array(UInt64)`) - 64-bit row positions deleted according to the deletion vector roaring bitmap | ||
|
|
||
| Deletion vectors whose declared `cardinality` exceeds an absolute materialization ceiling are rejected when `deleted_rows` is requested. Footer `deletion-vector-v1` properties (including that `cardinality` parses as an unsigned integer) are always validated. Selecting only `referenced_data_file` skips on-disk payload I/O and therefore also skips envelope, CRC, roaring deserialize, and the materialization ceiling — intentionally, so a path-only projection does not read up to the blob-size cap. | ||
|
|
||
| On-disk `deletion-vector-v1` blob length is bounded by an absolute ceiling (aligned with Iceberg's 2 GiB content-size check). When `deleted_rows` is requested, the reader peeks the envelope header (combined length and magic) before allocating the full payload; CRC is verified after the bounded read. | ||
|
|
||
| LZ4-compressed and uncompressed puffin footers are supported. Footer payload size (and declared LZ4 content size) is bounded by a compression ratio where applicable and an absolute ceiling; oversized footers are rejected before allocation. | ||
|
|
||
| Only a subset of output columns can be requested. A user-provided structure with unexpected column names or types is rejected when the format is created. | ||
|
|
||
| ## Example usage {#example-usage} | ||
|
|
||
| Read deleted row positions with the referenced data file: | ||
|
|
||
| ```sql | ||
| SELECT referenced_data_file, deleted_rows | ||
| FROM file(deletes.puffin, Puffin); | ||
| ``` | ||
|
|
||
| Expand deleted positions into individual rows: | ||
|
|
||
| ```sql | ||
| SELECT referenced_data_file, row_number | ||
| FROM file(deletes.puffin, Puffin) | ||
| ARRAY JOIN deleted_rows AS row_number | ||
| ORDER BY referenced_data_file, row_number; | ||
| ``` | ||
|
|
||
| Use `PuffinMetadata` to inspect footer blob descriptors before reading deletion vectors. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| description: 'Documentation for the PuffinMetadata format' | ||
| input_format: true | ||
| output_format: false | ||
| keywords: ['PuffinMetadata'] | ||
| sidebar_label: 'PuffinMetadata' | ||
| sidebar_position: 2 | ||
| slug: /interfaces/formats/PuffinMetadata | ||
| title: 'PuffinMetadata' | ||
| doc_type: 'reference' | ||
| --- | ||
|
|
||
| ## Description {#description} | ||
|
|
||
| Special input format for reading [Apache Iceberg Puffin](https://iceberg.apache.org/puffin-spec/) file footer metadata. | ||
| It outputs one row per blob entry from the footer `BlobMetadata` list. | ||
|
|
||
| Fixed output columns: | ||
| - `blob_type` (`String`) - blob type, for example `deletion-vector-v1` | ||
| - `snapshot_id` (`Int64`) - snapshot id of the blob | ||
| - `sequence_number` (`Int64`) - sequence number of the blob | ||
| - `fields` (`Array(Int32)`) - list of field ids the blob applies to | ||
| - `offset` (`Int64`) - offset of the blob payload in the file | ||
| - `length` (`Int64`) - length of the blob payload in bytes | ||
| - `compression_codec` (`String`) - compression codec of the blob payload, if present | ||
| - `properties` (`Map(String, String)`) - blob-specific properties | ||
|
|
||
| Optional top-level `FileMetadata.properties` in the footer (for example `created-by`) are type-checked when present but are not returned as columns. If the key is present it must be a JSON object with string values (null is rejected). | ||
|
|
||
| LZ4-compressed and uncompressed puffin footers are supported. Footer payload size (and declared LZ4 content size) is bounded by a compression ratio where applicable and an absolute ceiling; oversized footers are rejected before allocation. | ||
|
|
||
| ## Example usage {#example-usage} | ||
|
|
||
| Inspect footer blobs: | ||
|
|
||
| ```sql | ||
| SELECT blob_type, snapshot_id, sequence_number, offset, length, compression_codec, | ||
| mapKeys(properties), mapValues(properties) | ||
| FROM file(deletes.puffin, PuffinMetadata); | ||
| ``` | ||
|
|
||
| Pair with the `Puffin` format to read `deletion-vector-v1` blob payloads. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.