[SPARK-52991][SQL][FOLLOW-UP] Revise MergeIntoTable to use lazy val and add a new test#52362
[SPARK-52991][SQL][FOLLOW-UP] Revise MergeIntoTable to use lazy val and add a new test#52362szehon-ho wants to merge 1 commit intoapache:masterfrom
MergeIntoTable to use lazy val and add a new test#52362Conversation
…SCHEMA EVOLUTION and add test
| override def right: LogicalPlan = sourceTable | ||
| override protected def withNewChildrenInternal( | ||
| newLeft: LogicalPlan, newRight: LogicalPlan): MergeIntoTable = | ||
| copy(targetTable = newLeft, sourceTable = newRight) |
There was a problem hiding this comment.
Hi, @szehon-ho . May I ask why you propose to move the above 5 lines as an optimization? This doesn't look like an optimization. If this is a simple relocation, I'd ask you revert this change from this PR because this PR's title is Small optimization for ....
There was a problem hiding this comment.
Hi @dongjoon-hyun thanks for looking at it, yes its a minor cleanup, i noticed the other lazy vals are above the left, right, etc and move these ones to join them. I can revert it tomorrow if its an issue
There was a problem hiding this comment.
Got it. No problem. Let me revise the PR title and description a little and merge this, @szehon-ho. Thank you.
MergeIntoTable to use lazy val and add a new test
|
Merged to master for Apache Spark 4.1.0-preview2. Thank you, @szehon-ho . |
|
Thank you, @dongjoon-hyun ! |
…l` and add a new test ### What changes were proposed in this pull request? Minor follow up for apache#51698 1. Small optimization for MergeIntoTable node (aokolnychyi noticed post-commit that the new states can be calculated once using `lazy val`, as each time rules will copy the node so the state never changes). 2. Relocate `left`, `right`, `withNewChildrenInternal` 3. Add test to validate that default values work in schema evolution case. ### Why are the changes needed? Small analysis performance improvement and increase test coverage ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Run existing tests, and the patch adds another test ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#52362 from szehon-ho/merge_schema_evolution_follow. Authored-by: Szehon Ho <szehon.apache@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
What changes were proposed in this pull request?
Minor follow up for #51698
lazy val, as each time rules will copy the node so the state never changes).left,right,withNewChildrenInternalWhy are the changes needed?
Small analysis performance improvement and increase test coverage
Does this PR introduce any user-facing change?
No
How was this patch tested?
Run existing tests, and the patch adds another test
Was this patch authored or co-authored using generative AI tooling?
No