-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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-40416][SQL] Move subquery expression CheckAnalysis error messages to use the new error framework #37840
Conversation
Hi @MaxGekk @srielau can you please help review this? 🙏 it helps make error messages better with respect to subquery expression analysis. @allisonwang-db FYI |
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 awesome! Thanks @dtenedor.
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
Can one of the admins verify this patch? |
sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
fetch latest from master
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
Outdated
Show resolved
Hide resolved
stash respond to code review comments stash respond to code review comments update tests
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.
Thank you all @allisonwang-db @srielau @MaxGekk @gengliangwang for your helpful review. I responded to all comments, please take another look. Hat-tip to Gengliang with a helpful suggestion to add an overload expression.failAnalysis
to propagate query contexts while adding the new error classes and minimizing diffs in CheckAnalysis
.
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
respond to code review comments respond to code review comments update update update update
fetch latest changes from master
sql/core/src/test/resources/sql-tests/results/udf/udf-except.sql.out
Outdated
Show resolved
Hide resolved
...ore/src/test/resources/sql-tests/results/subquery/negative-cases/invalid-correlation.sql.out
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
Show resolved
Hide resolved
@gengliangwang thanks, this is done. We can see the new query contexts in this PR at the latest commit, they appear more accurate now. |
Hi @MaxGekk I responded to your comments, please take another look at this when you have time. 🙏 @gengliangwang @allisonwang-db @srielau FYI |
sql/core/src/test/resources/sql-tests/results/join-lateral.sql.out
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
Friendly ping @MaxGekk @allisonwang-db @gengliangwang can we please review this again? |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/package.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
LGTM except one comment |
respond to code review comments update update update simplify reuse existing plan canonicalize method respond to code review comments
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
Thanks, merging to master |
What changes were proposed in this pull request?
Move subquery expression CheckAnalysis error messages to use the new error framework.
This will help improve the usability of Apache Spark as a product, and link against documentation.
Why are the changes needed?
Error messages related to SQL query analysis in Apache Spark need some work to make them more descriptive and actionable.
Does this PR introduce any user-facing change?
Yes, error messages change.
How was this patch tested?
Unit test and query test coverage shows the updates in error messages received.