-
Notifications
You must be signed in to change notification settings - Fork 140
Backport #1097 to v1.5-variegata: write delete manifests with content='deletes' #1100
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
Merged
Tishj
merged 1 commit into
duckdb:v1.5-variegata
from
raghav-reglobe:backport-delete-manifest-content-v1.5-variegata
Jun 22, 2026
Merged
Changes from all commits
Commits
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
49 changes: 49 additions & 0 deletions
49
.../catalog_test_config_setup/catalog_agnostic/delete/test_delete_manifest_content_type.test
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,49 @@ | ||
| # name: test/sql/local/catalog_test_config_setup/catalog_agnostic/delete/test_delete_manifest_content_type.test | ||
| # description: A v3 DELETE must write its delete manifest's Avro 'content' file metadata as 'deletes', not 'data' | ||
| # group: [delete] | ||
|
|
||
| require-env CATALOG_TEST_CONFIG_SETUP | ||
|
|
||
| require avro | ||
|
|
||
| require parquet | ||
|
|
||
| require iceberg | ||
|
|
||
| require httpfs | ||
|
|
||
| statement ok | ||
| DROP TABLE IF EXISTS my_datalake.default.delete_manifest_content; | ||
|
|
||
| statement ok | ||
| CREATE TABLE my_datalake.default.delete_manifest_content (id INTEGER, data VARCHAR) WITH ('format-version' = 3); | ||
|
|
||
| statement ok | ||
| INSERT INTO my_datalake.default.delete_manifest_content VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'); | ||
|
|
||
| # A v3 DELETE writes a delete manifest (content type DELETE) that holds the deletion vector. | ||
| statement ok | ||
| DELETE FROM my_datalake.default.delete_manifest_content WHERE id IN (2, 4); | ||
|
|
||
| # Resolve the path of the manifest holding the deletion vector (POSITION_DELETES) entries. | ||
| statement ok | ||
| set variable delete_manifest = ( | ||
| SELECT DISTINCT manifest_path FROM iceberg_metadata(my_datalake.default.delete_manifest_content) | ||
| WHERE content = 'POSITION_DELETES' | ||
| LIMIT 1 | ||
| ); | ||
|
|
||
| # The delete manifest's Avro file metadata must carry content='deletes' (not 'data'). The Avro | ||
| # OCF header stores the metadata map as [key][value] with zig-zag length prefixes, so the | ||
| # 'content' -> 'deletes' pair is the byte sequence 0x0E "content" 0x0E "deletes" (each 7-byte | ||
| # string prefixed by its length 7, zig-zag encoded as 0x0E). A delete manifest mislabeled as | ||
| # 'data' would instead contain 0x0E "content" 0x08 "data". | ||
| # has_deletes : count of read manifests carrying content='deletes' (expected 1) | ||
| # has_data : count carrying the mislabeled content='data' (expected 0) | ||
| query II | ||
| SELECT | ||
| count(*) FILTER (WHERE position('0e636f6e74656e740e64656c65746573' IN lower(hex(content))) > 0) AS has_deletes, | ||
| count(*) FILTER (WHERE position('0e636f6e74656e740864617461' IN lower(hex(content))) > 0) AS has_data | ||
| FROM read_blob(getvariable('delete_manifest')); | ||
| ---- | ||
| 1 0 | ||
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.
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.
Why does
read_avro(getvariable('delete_manifest'))not work here?