-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-40890][SQL][TESTS] Check error classes in DataSourceV2SQLSuite #38439
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
|
Can one of the admins verify this patch? |
|
cc @MaxGekk |
| parameters = Map("cmd" -> sqlCommand)) | ||
| } | ||
|
|
||
| private def assertAnalysisErrorClass( |
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.
Let's remove assertAnalysisErrorClass(), and use checkError() directly. You could introduce an method analysisException as we did before for ParseException
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.
Done
| errorClass: String, | ||
| parameters: Map[String, String]): Unit = { | ||
| checkError( | ||
| exception = intercept[AnalysisException] { | ||
| sql(sqlStatement) | ||
| }, | ||
| errorClass = errorClass, | ||
| parameters = parameters | ||
| ) |
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.
Let's introduce a helper method for this:
exception = intercept[AnalysisException] {
sql(sqlStatement)
},and invoke checkError directly.
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.
Done
MaxGekk
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.
Waiting for CI.
|
@panbingkun Please, fix the code style issue: |
Done. |
|
It seems this is related to your changes: Most likely after 3c967f0, need to merge/rebase the master. |
Done, waiting for CI. |
|
+1, LGTM. Merging to master. I ran the test locally. |
### What changes were proposed in this pull request? This PR aims to replace 'intercept' with 'Check error classes' in DataSourceV2SQLSuite. ### Why are the changes needed? The changes improve the error framework. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? By running the modified test suite: ``` $ build/sbt "test:testOnly *DataSourceV2SQLSuite" ``` Closes apache#38439 from panbingkun/SPARK-40890. Authored-by: panbingkun <pbk1982@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
What changes were proposed in this pull request?
This PR aims to replace 'intercept' with 'Check error classes' in DataSourceV2SQLSuite.
Why are the changes needed?
The changes improve the error framework.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
By running the modified test suite: