-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-22954][SQL] Fix the exception thrown by Analyze command on temporary views to throw AnalysisException #20177
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
…ooked up by session state's catalog.
…d instead of Some('default')
…ad of NoSuchTableException
|
ok to test |
|
what's the error message after this patch? |
|
Test build #85781 has finished for PR 20177 at commit
|
|
The error message after the patch: |
|
can you fix the test? |
| assertNoSuchTable(s"SHOW PARTITIONS $viewName") | ||
| assertNoSuchTable(s"ANALYZE TABLE $viewName COMPUTE STATISTICS") | ||
| assertNoSuchTable(s"ANALYZE TABLE $viewName COMPUTE STATISTICS FOR COLUMNS id") | ||
| assertAnalysisException(s"ANALYZE TABLE $viewName COMPUTE STATISTICS") |
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 should also check the error message to ensure the AnalysisException is not thrown from elsewhere.
|
We shall also update |
…ands - AnalyzeColum and AnalyzePartition. Fix tests to check if the error messages are proper.
|
Test build #86424 has finished for PR 20177 at commit
|
|
Test build #86425 has finished for PR 20177 at commit
|
|
I updated AnalyzePartitionCommand and AnalyzeColumnCommand. I noticed another one - According to SQLViewSuite, calling truncate on view must throw NoSuchTable, where as in TruncateTableCommand class I noticed this A bug? |
|
Test build #86426 has finished for PR 20177 at commit
|
|
actually it's not really useful to have |
|
I did't understand why the build is getting killed. |
|
retest this please |
|
Test build #86506 has finished for PR 20177 at commit
|
|
Could you also add test cases that cover ANALYZE PARTITION and ANALYZE COLUMN queries? |
…rtition on view throws AnalyzeException telling that it isn't supported on views.
|
Done. Added test cases to cover ANALYZE PARTITION and ANALYZE COLUMN queries. |
|
Test build #86791 has finished for PR 20177 at commit
|
|
ok to test |
|
cc @wzhfy |
|
Test build #90807 has finished for PR 20177 at commit
|
|
Can one of the admins verify this patch? |
What changes were proposed in this pull request?
Previously running ANALYZE on temporary views produced NoSuchTableException even though the view was present. It is misleading. So it has to be changed to throw AnalysisException since it comes in the analysis part.
How was this patch tested?
Some unit tests were fixed to intercept AnalysisException instead of NoSuchTableException.