-
Couldn't load subscription status.
- Fork 3.4k
Refactor merge to support partial update #24075
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
Conversation
8acd081 to
154b8ad
Compare
ff5e383 to
75e4c1c
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.
This looked pretty good to me. Thanks for undertaking this work!
The PR needs Phoenix tests that show that only updated columns are changed. The tests need to cover cases where a single column is updated in a single row and in multiple rows; where non-overlapping sets of columns are updated in different cases; and tests that include UPDATE as well as INSERT and DELETE cases.
We also need @electrum to take a look.
2aca964 to
c49ad8b
Compare
329425e to
550ff10
Compare
77fd80d to
3c40911
Compare
290d09f to
78efc6a
Compare
437b674 to
c58acdc
Compare
71ebb33 to
f26d04b
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.
I'm approving this PR, but we still need @electrum to take a look. I'll ping him now about it.
plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestPhoenixConnectorTest.java
Outdated
Show resolved
Hide resolved
1d3f6af to
555b183
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.
Reviewed initially first commit.
core/trino-main/src/main/java/io/trino/operator/DeleteAndInsertMergeProcessor.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
555b183 to
8ef1bf0
Compare
|
Thanks! |
Description
Currently the
updateimplementation of MERGE update updates the whole row, this pr is going to update the engine merge impl to support partial update.The main idea is to keep the
merge case_numberof theUpdateCasein the output of theMergeProcessNode,(this value already kept in themerge_rowsymbol that in the sourceNode of theMergeProcessNode, so only needs to project it), and then in theMergeWriterNode, theupdateSinkcan perform the update according to the update case.The partial update also needs to know the mapping of the case number with the relevant columns, thus the
ConnectorMetadata#beginMergeis refactored to hold the info.Here use the Phoenix connector as a example to show how it works.
Additional context and related issues
Prerequisites for #23034
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
() Release notes are required, with the following suggested text: