cloud-fan commented on code in PR #39592:
URL: https://github.com/apache/spark/pull/39592#discussion_r1073134738
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/rules/RuleExecutor.scala:
##########
@@ -191,10 +194,14 @@ abstract class RuleExecutor[TreeType <: TreeNode[_]]
extends Logging {
val tracker: Option[QueryPlanningTracker] = QueryPlanningTracker.get
val beforeMetrics = RuleExecutor.getCurrentMetrics()
- // Run the structural integrity checker against the initial input
- if (!isPlanIntegral(plan, plan)) {
- throw
QueryExecutionErrors.structuralIntegrityOfInputPlanIsBrokenInClassError(
- this.getClass.getName.stripSuffix("$"))
+ // Validate the initial input
+ try {
+ validate(plan, plan)
+ } catch {
+ case e: SparkException if
SparkThrowableHelper.isInternalError(e.getErrorClass) =>
+ val ruleExecutorName = this.getClass.getName.stripSuffix("$")
+ throw SparkException.internalError(
+ "The structural integrity of the input plan is broken in " +
ruleExecutorName, e)
Review Comment:
Currently, the error is like
```
SparkException: The structural integrity ... by rule xxx in batch yyy
at ...
... stacktrace
Caused by SparkException: The plan is unresolved ...
at ...
... stacktrace
```
I agree that throwing one single exception is better. I'll update soon.
--
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]