-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-54491][SQL] Fix insert into temp view on DSv2 table failure #53196
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
dongjoon-hyun
left a comment
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.
Could you double-check Maven build failure, @manuzhang ?
Error: ] /home/runner/work/spark/spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:1194: not found: type V2TableReference
Error: ] /home/runner/work/spark/spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:1195: value resolveReference is not a member of org.apache.spark.sql.catalyst.analysis.RelationResolution
|
cc @gengliangwang , too. |
e76cb87 to
2929ee1
Compare
| val relation = table match { | ||
| case u: UnresolvedRelation if !u.isStreaming => | ||
| resolveRelation(u).getOrElse(u) | ||
| case r: V2TableReference => |
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.
Can this ever be DataSourceV2Relation itself? I am asking primarily as there is resolveAsV2Relation that handles both below.
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.
We already have ResolveInsertInto to handle it.
dongjoon-hyun
left a comment
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.
+1, LGTM. Thank you, @manuzhang and @aokolnychyi .
Merged to master/4.1 for Apache Spark 4.1.0.
### What changes were proposed in this pull request? Resolve `V2TableReference` for table in `InsertIntoStatement`. ### Why are the changes needed? #52876 brought in `V2TableReference` which broke relation resolution for insert into temp view on DSv2 table. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Add UT. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #53196 from manuzhang/FIX-SPARK-54491. Authored-by: manuzhang <owenzhang1990@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 3f5a2b9) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
|
good catch! late LGTM |
|
Thanks, @manuzhang! |
### What changes were proposed in this pull request? Resolve `V2TableReference` for table in `InsertIntoStatement`. ### Why are the changes needed? apache#52876 brought in `V2TableReference` which broke relation resolution for insert into temp view on DSv2 table. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Add UT. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#53196 from manuzhang/FIX-SPARK-54491. Authored-by: manuzhang <owenzhang1990@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
What changes were proposed in this pull request?
Resolve
V2TableReferencefor table inInsertIntoStatement.Why are the changes needed?
#52876 brought in
V2TableReferencewhich broke relation resolution for insert into temp view on DSv2 table.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Add UT.
Was this patch authored or co-authored using generative AI tooling?
No.