-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Support deleting whole partitions in Iceberg table #21048
Conversation
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.
My main concern is about semantics of delete with snapshots/partition evolution. It's not clear to me how exactly this is handled. Also, we should probably update the docs. Looks good otherwise though!!
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedTestBase.java
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
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.
Looks good! Mostly just small nits now. I think we should also update the docs to specify this is now supported and limited to partition-only and without specific snapshots
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergTableHandle.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/optimizer/IcebergPlanOptimizer.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
Codenotify: Notifying subscribers in CODENOTIFY files for diff 384aca5...6fcc0eb.
|
Fixes are done, and iceberg doc is updated. Please take a look. |
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.
Two minor grammatical suggestions on the docs, but @steveburnett might have better ones. Otherwise LGTM!
@ZacBlanco Thanks a lot, I will squash them into one commit 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.
Nice work! I made a couple of suggestions for consistency and clarity.
|
||
Columns in the filter must all be identity transformed partition columns of the target table. | ||
|
||
Do not support non-comparison operator for the filter columns, for example ADD, SUBTRACT, MODULUS, etc. |
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.
Latin such as etc., e.g, i.e, should be avoided. For an example of a standard for this, see the GitLab recommended word list entry for etc.. To address this adapting @ZacBlanco's suggestion, consider something like this.
Do not support non-comparison operator for the filter columns, for example ADD, SUBTRACT, MODULUS, etc. | |
Filtered columns only support comparison operators, such as EQUALS, LESS THAN, or LESS THAN EQUALS. |
@steveburnett Thanks a lot. I have update the docs following your suggestion, and squash them into one commit. Please take a look. |
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.
LGTM! (docs)
Updated my local branch just now and built the docs locally to pick up and review the latest changes as they will be seen in production, everything looks great.
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.
@hantangwangd Thanks for your work! This is a nice feature that would benefit the connector users.
Just left some minor comments.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergTableHandle.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Show resolved
Hide resolved
@hantangwangd BTW, do you want to add a release note? |
@ChunxuTang Sure, release note have been added. |
We can use 'delete from <table> [where <predicate>]' to delete whole partitions or all data in Iceberg table. The predicate should satisfy some requirements: - The columns appeared in predicate should all be identity partitioned columns, that is, use their original value as partition value. - The columns appeared in predicate should not be wrapped in a non-comparison operator(for example ADD, SUBTRACT, MODULUS etc.) Co-authored-by: Zac Blanco <[email protected]> Co-authored-by: Steve Burnett <[email protected]>
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.
LGTM. @hantangwangd Thanks for the work again.
Re-running the failed test. |
@ChunxuTang It's my pleasure. |
Description
We can use
delete from <table> [where <predicate>];
to delete one or more whole partitions or all data in Iceberg table when some conditions are met:Motivation and Context
This PR allows deleting partition level data from Iceberg tables.
Test Plan
Contributor checklist
Release Notes