panbingkun commented on code in PR #46222:
URL: https://github.com/apache/spark/pull/46222#discussion_r1579168071
##########
core/src/test/scala/org/apache/spark/SparkFunSuite.scala:
##########
@@ -361,27 +361,30 @@ abstract class SparkFunSuite
} else {
assert(expectedParameters === parameters)
}
- val actualQueryContext = exception.getQueryContext()
- assert(actualQueryContext.length === queryContext.length, "Invalid length
of the query context")
- actualQueryContext.zip(queryContext).foreach { case (actual, expected) =>
- assert(actual.contextType() === expected.contextType,
- "Invalid contextType of a query context Actual:" + actual.toString)
- if (actual.contextType() == QueryContextType.SQL) {
- assert(actual.objectType() === expected.objectType,
- "Invalid objectType of a query context Actual:" + actual.toString)
- assert(actual.objectName() === expected.objectName,
- "Invalid objectName of a query context. Actual:" + actual.toString)
- assert(actual.startIndex() === expected.startIndex,
- "Invalid startIndex of a query context. Actual:" + actual.toString)
- assert(actual.stopIndex() === expected.stopIndex,
- "Invalid stopIndex of a query context. Actual:" + actual.toString)
- assert(actual.fragment() === expected.fragment,
- "Invalid fragment of a query context. Actual:" + actual.toString)
- } else if (actual.contextType() == QueryContextType.DataFrame) {
- assert(actual.fragment() === expected.fragment,
- "Invalid code fragment of a query context. Actual:" +
actual.toString)
- assert(actual.callSite().matches(expected.callSitePattern),
- "Invalid callSite of a query context. Actual:" + actual.toString)
+ val actualQueryContext = exception.getQueryContext
Review Comment:
If the `if (actualQueryContext != null)` is not added, the following error
will occur:
<img width="893" alt="image"
src="https://github.com/apache/spark/assets/15246973/8878f9a2-c148-4457-9a3d-fd9fef783592">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]