[SPARK-46484][SQL][CONNECT] Retain plan_id in ResolveUnpivot and UnpivotCoercion #44454
Closed
zhengruifeng wants to merge 4 commits intoapache:masterfrom
Closed
[SPARK-46484][SQL][CONNECT] Retain plan_id in ResolveUnpivot and UnpivotCoercion #44454zhengruifeng wants to merge 4 commits intoapache:masterfrom
plan_id in ResolveUnpivot and UnpivotCoercion #44454zhengruifeng wants to merge 4 commits intoapache:masterfrom
Conversation
ed4bb07 to
ae4a2f3
Compare
zhengruifeng
added a commit
that referenced
this pull request
Dec 29, 2023
… keep the plan id ### What changes were proposed in this pull request? 1, make following helper functions keep the plan id in transformation: - `resolveOperatorsDownWithPruning` - `resolveOperatorsUpWithNewOutput` 2, change the way to keep plan id in `ResolveNaturalAndUsingJoin`: before: ``` Project <- tag hiddenOutputTag - Join <- tag PLAN_ID_TAG ``` after: ``` Project <- tag hiddenOutputTag & PLAN_ID_TAG - Join ``` 3, to verify this fix, this PR also reverts previous tags copying changes in the rules ### Why are the changes needed? we had make following rules keep the plan id: 1, `ResolveNaturalAndUsingJoin` in 167bbca - using `resolveOperatorsUpWithPruning`, it set the tag `Project.hiddenOutputTag` internally, so `copyTagsFrom` (only works if `tags.isEmpty`) in `resolveOperatorsUpWithPruning` takes no effect 2, `ExtractWindowExpressions` in 185a0a5 - using `resolveOperatorsDownWithPruning`, which doesn't copy tags 3, `WidenSetOperationTypes` in 17c206f - using `resolveOperatorsUpWithNewOutput -> transformUpWithNewOutput`, which doesn't copy tags 4, `ResolvePivot` in 1a89bdc - using `resolveOperatorsWithPruning -> resolveOperatorsDownWithPruning`, which doesn't copy tags 5, `CTESubstitution` in 79d1cde - using both `resolveOperatorsDownWithPruning` and `resolveOperatorsUp -> resolveOperatorsUpWithPruning`, the former does't copy tags But plan id missing issue still keep popping up (see #44454), so this PR attempt to cover more cases by fixing the helper functions which are used to build the rules 6, `ResolveUnpivot` - using `resolveOperatorsWithPruning -> resolveOperatorsDownWithPruning`, which doesn't copy tags 7, `UnpivotCoercion` - using `resolveOperators -> resolveOperatorsWithPruning -> resolveOperatorsDownWithPruning`, which doesn't copy tags ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? ut ### Was this patch authored or co-authored using generative AI tooling? no Closes #44462 from zhengruifeng/sql_res_op_keep. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
Contributor
Author
|
close in favor of #44462 |
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?
Retain
plan_idinResolveUnpivotandUnpivotCoercionWhy are the changes needed?
they drop the plan id and cause:
Does this PR introduce any user-facing change?
yes, bug fix
How was this patch tested?
added ut
Was this patch authored or co-authored using generative AI tooling?
no