[SPARK-43204][SQL] Align MERGE assignments with table attributes#40919
Closed
aokolnychyi wants to merge 1 commit into
Closed
[SPARK-43204][SQL] Align MERGE assignments with table attributes#40919aokolnychyi wants to merge 1 commit into
aokolnychyi wants to merge 1 commit into
Conversation
3eaf521 to
462c861
Compare
aokolnychyi
commented
Apr 23, 2023
| "cols" -> cols)) | ||
| } | ||
| resolved | ||
| resolved match { |
Contributor
Author
There was a problem hiding this comment.
This change is needed as references to nested columns in MERGE are resolved like a.nested_col.i AS i (with added aliases), which breaks our assumption about what kind of keys we expect. Let me know if anyone can spot any edge cases when it is not safe.
Contributor
Author
|
@cloud-fan @sunchao @viirya @huaxingao @dongjoon-hyun @gengliangwang, this is a follow-up to PR #40308. |
cloud-fan
approved these changes
Apr 25, 2023
Contributor
|
thanks, merging to master! |
Contributor
Author
|
Thanks for reviewing, @cloud-fan! |
viirya
pushed a commit
to viirya/spark-1
that referenced
this pull request
Oct 19, 2023
### What changes were proposed in this pull request? This PR extends `ResolveRowLevelCommandAssignments` to also cover MERGE assignments. ### Why are the changes needed? Similar to SPARK-42151, these changes are needed so that we can rewrite MERGE statements into executable plans for tables that support row-level operations. In particular, our row-level mutation framework assumes Spark is responsible for building an updated version of each affected row and that row is passed back to the data source. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? This PR comes with tests. Closes apache#40919 from aokolnychyi/spark-43204. Authored-by: aokolnychyi <aokolnychyi@apple.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 331e5bb)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
This PR extends
ResolveRowLevelCommandAssignmentsto also cover MERGE assignments.Why are the changes needed?
Similar to SPARK-42151, these changes are needed so that we can rewrite MERGE statements into executable plans for tables that support row-level operations. In particular, our row-level mutation framework assumes Spark is responsible for building an updated version of each affected row and that row is passed back to the data source.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
This PR comes with tests.