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-39905][SQL][TESTS] Remove checkErrorClass()
and use checkError()
instead
#37322
Conversation
sql/core/src/test/scala/org/apache/spark/sql/DatasetUnpivotSuite.scala
Outdated
Show resolved
Hide resolved
checkErrorClass()
and use checkError()
insteadcheckErrorClass()
and use checkError()
instead
cc @srielau |
@cloud-fan @HyukjinKwon @gengliangwang Could you have a look at the PR, please. I wanna switch Serge's checkError completely, and extend checkError() to check query context as the next step. |
"\"BIGINT\" \\(`long1#\\d+L`, `long2#\\d+L`\\)\\];(\n.*)*", | ||
matchMsg = true) | ||
errorSubClass = None, | ||
sqlState = None, |
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.
Does checkError
provide default parameter value for errorSubClass
and sqlState
?
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.
It has but if I remove settings of the parameters, I am getting the errors:
overloaded method value checkError with alternatives:
(exception: org.apache.spark.SparkThrowable,errorClass: String,parameters: Map[String,String])Unit <and>
(exception: org.apache.spark.SparkThrowable,errorClass: String,sqlState: String,parameters: Map[String,String])Unit <and>
(exception: org.apache.spark.SparkThrowable,errorClass: String,errorSubClass: String,sqlState: String,parameters: Map[String,String])Unit <and>
(exception: org.apache.spark.SparkThrowable,errorClass: String,errorSubClass: Option[String],sqlState: Option[String],parameters: Map[String,String],matchPVals: Boolean)Unit
cannot be applied to (exception: org.apache.spark.sql.AnalysisException, errorClass: String, parameters: scala.collection.immutable.Map[String,String], matchPVals: Boolean)
checkError(
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 me add the overloaded method:
protected def checkError(
exception: SparkThrowable,
errorClass: String,
parameters: Map[String, String],
matchPVals: Boolean): Unit =
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.
but I think it is better to set default values in the most wide method. I will remove one overloaded method and add default values.
@anchovYu @cloud-fan @HyukjinKwon @gengliangwang Could you review this PR, please. |
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.
Thanks for the test infra work!
Merging to master. Thank you, @gengliangwang for review. |
…Error()` ### What changes were proposed in this pull request? 1. Re-implemented `validateParsingError()` using `checkError()`. 2. Removed `checkParsingError()` and replaced by `checkError()`. ### Why are the changes needed? 1. To prepare test infra for testing of query contexts. 3. To check message parameters instead of entire text message. This PR is some kind of follow up of #36693 and #37322. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? By running the modified test suites: ``` $ build/sbt -Phive -Phive-thriftserver "test:testOnly *TruncateTableParserSuite" $ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *ShowPartitionsParserSuite" $ build/sbt "sql/testOnly *QueryParsingErrorsSuite" ``` Closes #37363 from MaxGekk/checkParsingError-to-checkError. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
What changes were proposed in this pull request?
Replace all invokes of
checkErrorClass()
bycheckError()
and removecheckErrorClass()
.Why are the changes needed?
Does this PR introduce any user-facing change?
No.
How was this patch tested?
By running the modified test suites: