-
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
Add UPDATE support for Iceberg #24281
Conversation
e56fc7c
to
f0a29a0
Compare
94cc4b3
to
4aa34a0
Compare
Thanks for the release note! Formatting nits:
|
8961a59
to
c66c259
Compare
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.
Thanks for implementing this great feature. Some little problems and nits during the first rough inspection, and will take a detailed look in a couple of days.
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
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.
Thanks for this high-quality implementation, overall looks good to me, only some little nits.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPageSourceProvider.java
Outdated
Show resolved
Hide resolved
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/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedTestBase.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.
Thanks for the PR! I'm sorry for the delay in reviewing it. I completed a partial review and will continue with the rest.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergErrorCode.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/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
...o-iceberg/src/main/java/com/facebook/presto/iceberg/ConnectorPageSourceWithRowPositions.java
Outdated
Show resolved
Hide resolved
...o-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPartitionInsertingPageSource.java
Outdated
Show resolved
Hide resolved
...o-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPartitionInsertingPageSource.java
Outdated
Show resolved
Hide resolved
...o-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPartitionInsertingPageSource.java
Show resolved
Hide resolved
...o-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPartitionInsertingPageSource.java
Outdated
Show resolved
Hide resolved
13e3782
to
52c43b4
Compare
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.
Thanks for the whole work, looks good to me, only a couple of little nits.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.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.
Thanks for the PR, almost LGTM, just a couple of nits.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/com/facebook/presto/sql/planner/optimizations/StreamPropertyDerivations.java
Show resolved
Hide resolved
New release note guidelines as of last week: PR #24354 automatically adds links to this PR to the release notes. Please remove the manual PR link in the following format from the release note entries for this PR.
I have updated the Release Notes Guidelines to remove the examples of manually adding the PR link. |
52c43b4
to
f432a16
Compare
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.
Thanks for the doc! A few suggestions, looks good overall.
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)
Pull updated branch, new local docs build, everything looks good. Thanks!
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, thanks for the PR @ZacBlanco
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.
Please clean up the commits.
1a7292c
to
e3d8733
Compare
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.
Just some nits, looks good
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
@@ -1237,8 +1256,8 @@ public static String metadataLocation(Table icebergTable) | |||
|
|||
/** | |||
* Get the data location for target {@link Table}, | |||
* considering iceberg table properties {@code WRITE_DATA_LOCATION}, {@code OBJECT_STORE_PATH} and {@code WRITE_FOLDER_STORAGE_LOCATION} | |||
* */ | |||
* considering iceberg table properties {@code WRITE_DATA_LOCATION}, {@code OBJECT_STORE_PATH} and {@code WRITE_FOLDER_STORAGE_LOCATION} |
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.
I know the comments were improperly formatted before, but can you revert this? It would just muddle the git blame.
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.
IntelliJ IDE likes to auto-format these...maybe I'll open a separate PR to apply formatting to the entire connector. This seems to happen quite often
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUtil.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPageSourceProvider.java
Outdated
Show resolved
Hide resolved
...o-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPartitionInsertingPageSource.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java
Outdated
Show resolved
Hide resolved
3e8eacc
e3d8733
to
3e8eacc
Compare
Without this change, the UpdateOperator would throw an exception stating that there was no valid page source. This occurs because the driver which is responsible for setting the UpdateablePageSource never calls the proper method due to never receiving any inputs. This now handles the case where the page source is never set by returning an EmptySplitPageSource
This commit allows users to perform row-level updates when using the Iceberg connector with Java-based workers. This is achieved by improving on the IcebergUpdatablePageSource to implement the updateRows method. The implementation passes a generated row ID column as a field in the page required by updateRows. Then during updateRows, generated a positionDelete file entry for the row ID, and also writes the row's updated value to a new page sink for the newly updated data. These new files are then commited in a rowDelta transaction within the Iceberg connector metadata after processing is complete. Co-Authored-By: Nidhin Varghese <Nidhin.Varghese1@ibm.com> Co-Authored-By: Anoop V S <anoop.v.s@ibm.com>
3e8eacc
to
cd4df4f
Compare
Description
This PR adds support in the Iceberg connector for
UPDATE
operations.Motivation and Context
Row-level table
UPDATE
supportImpact
update_mode
table property on Iceberg tablesUPDATE <x> SET ... WHERE ...
queries can now run successfullyTest Plan
Comprehensive set of unit tests for different tables and column types.
Contributor checklist
Release Notes