-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
[SPARK-49366][CONNECT] Treat Union node as leaf in dataframe column resolution #47853
Closed
Conversation
This file contains 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
zhengruifeng
changed the title
[SPARK-49366][CONNECT] Delay the ambiguous detection in column resolution
[WIP][SPARK-49366][CONNECT] Delay the ambiguous detection in column resolution
Aug 23, 2024
zhengruifeng
changed the title
[WIP][SPARK-49366][CONNECT] Delay the ambiguous detection in column resolution
[SPARK-49366][CONNECT] Delay the ambiguous detection in column resolution
Aug 26, 2024
zhengruifeng
force-pushed
the
fix_ambgious_union
branch
from
August 26, 2024 13:38
d629b76
to
3864c4d
Compare
zhengruifeng
changed the title
[SPARK-49366][CONNECT] Delay the ambiguous detection in column resolution
[SPARK-49366][CONNECT] Treat Union node as leaf in column resolution
Aug 26, 2024
zhengruifeng
changed the title
[SPARK-49366][CONNECT] Treat Union node as leaf in column resolution
[SPARK-49366][CONNECT] Treat Union node as leaf in dataframe column resolution
Aug 26, 2024
cloud-fan
approved these changes
Aug 26, 2024
resolveDataFrameColumnByPlanId(u, id, isMetadataAccess, p.children, currentDepth + 1) | ||
val children = p match { | ||
// treat Union node as the leaf node | ||
case _: Union => Seq.empty[LogicalPlan] |
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 is not specific to spark connect right?
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 is specific to connect only.
spark classic won't reach this path
merged to master |
IvanK-db
pushed a commit
to IvanK-db/spark
that referenced
this pull request
Sep 20, 2024
…esolution ### What changes were proposed in this pull request? Treat Union node as leaf in column resolution ### Why are the changes needed? bug fix: ``` from pyspark.sql.functions import concat, lit, col df1 = spark.range(10).withColumn("value", lit(1)) df2 = df1.union(df1) df1.join(df2, df1.id == df2.id, "left").show() ``` fails with `AMBIGUOUS_COLUMN_REFERENCE` ``` resolveExpressionByPlanChildren: e = '`==`('id, 'id) resolveExpressionByPlanChildren: q = '[id=63]Join LeftOuter, '`==`('id, 'id) :- [id=61]Project [id#550L, 1 AS value#553] : +- Range (0, 10, step=1, splits=Some(12)) +- [id=62]Union false, false :- [id=61]Project [id#564L, 1 AS value#565] : +- Range (0, 10, step=1, splits=Some(12)) +- [id=61]Project [id#566L, 1 AS value#567] +- Range (0, 10, step=1, splits=Some(12)) 'id with id = 61 [id=61]Project [id#564L, 1 AS value#565] +- Range (0, 10, step=1, splits=Some(12)) [id=61]Project [id#566L, 1 AS value#567] +- Range (0, 10, step=1, splits=Some(12)) resolved: Vector((Some((id#564L,1)),true), (Some((id#566L,1)),true)) ``` When resolving `'id with id = 61`, existing detection fails in the second child. ### Does this PR introduce _any_ user-facing change? yes, bug fix ### How was this patch tested? added tests ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#47853 from zhengruifeng/fix_ambgious_union. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
attilapiros
pushed a commit
to attilapiros/spark
that referenced
this pull request
Oct 4, 2024
…esolution ### What changes were proposed in this pull request? Treat Union node as leaf in column resolution ### Why are the changes needed? bug fix: ``` from pyspark.sql.functions import concat, lit, col df1 = spark.range(10).withColumn("value", lit(1)) df2 = df1.union(df1) df1.join(df2, df1.id == df2.id, "left").show() ``` fails with `AMBIGUOUS_COLUMN_REFERENCE` ``` resolveExpressionByPlanChildren: e = '`==`('id, 'id) resolveExpressionByPlanChildren: q = '[id=63]Join LeftOuter, '`==`('id, 'id) :- [id=61]Project [id#550L, 1 AS value#553] : +- Range (0, 10, step=1, splits=Some(12)) +- [id=62]Union false, false :- [id=61]Project [id#564L, 1 AS value#565] : +- Range (0, 10, step=1, splits=Some(12)) +- [id=61]Project [id#566L, 1 AS value#567] +- Range (0, 10, step=1, splits=Some(12)) 'id with id = 61 [id=61]Project [id#564L, 1 AS value#565] +- Range (0, 10, step=1, splits=Some(12)) [id=61]Project [id#566L, 1 AS value#567] +- Range (0, 10, step=1, splits=Some(12)) resolved: Vector((Some((id#564L,1)),true), (Some((id#566L,1)),true)) ``` When resolving `'id with id = 61`, existing detection fails in the second child. ### Does this PR introduce _any_ user-facing change? yes, bug fix ### How was this patch tested? added tests ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#47853 from zhengruifeng/fix_ambgious_union. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
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?
Treat Union node as leaf in column resolution
Why are the changes needed?
bug fix:
fails with
AMBIGUOUS_COLUMN_REFERENCE
When resolving
'id with id = 61
, existing detection fails in the second child.Does this PR introduce any user-facing change?
yes, bug fix
How was this patch tested?
added tests
Was this patch authored or co-authored using generative AI tooling?
No