cloud-fan commented on a change in pull request #31920:
URL: https://github.com/apache/spark/pull/31920#discussion_r611447060
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala
##########
@@ -618,29 +617,26 @@ abstract class SparkStrategies extends
QueryPlanner[SparkPlan] {
LocalTableScanExec(output, sink.allData.map(r => toRow(r).copy())) ::
Nil
case logical.Distinct(child) =>
- throw new IllegalStateException(
- "logical distinct operator should have been replaced by aggregate in
the optimizer")
+ throw QueryExecutionErrors.logicalOperatorNotReplacedError(
Review comment:
and all the changes in `BasicOperators`
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/CustomShuffleReaderExec.scala
##########
@@ -65,7 +66,7 @@ case class CustomShuffleReaderExec private(
case other => other
}
case _ =>
- throw new IllegalStateException("operating on canonicalization plan")
+ throw QueryExecutionErrors.operatingOnCanonicalizationPlanError()
Review comment:
ditto
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/CustomShuffleReaderExec.scala
##########
@@ -108,7 +109,7 @@ case class CustomShuffleReaderExec private(
case CoalescedPartitionSpec(startReducerIndex, endReducerIndex) =>
startReducerIndex.until(endReducerIndex).map(bytesByPartitionId).sum
case p: PartialReducerPartitionSpec => p.dataSize
- case p => throw new IllegalStateException("unexpected " + p)
+ case p => throw
QueryExecutionErrors.unexpectedShufflePartitionSpecError(p.toString)
Review comment:
ditto
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/CustomShuffleReaderExec.scala
##########
@@ -184,7 +185,7 @@ case class CustomShuffleReaderExec private(
sendDriverMetrics()
stage.shuffle.getShuffleRDD(partitionSpecs.toArray)
case _ =>
- throw new IllegalStateException("operating on canonicalized plan")
+ throw QueryExecutionErrors.operatingOnCanonicalizedPlanError()
Review comment:
ditto
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/QueryStageExec.scala
##########
@@ -165,7 +165,7 @@ case class ShuffleQueryStageExec(
case s: ShuffleExchangeLike => s
case ReusedExchangeExec(_, s: ShuffleExchangeLike) => s
case _ =>
- throw new IllegalStateException("wrong plan for shuffle stage:\n " +
plan.treeString)
+ throw QueryExecutionErrors.wrongPlanForShuffleStageError(plan.treeString)
Review comment:
ditto
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/QueryStageExec.scala
##########
@@ -217,7 +217,7 @@ case class BroadcastQueryStageExec(
case b: BroadcastExchangeLike => b
case ReusedExchangeExec(_, b: BroadcastExchangeLike) => b
case _ =>
- throw new IllegalStateException("wrong plan for broadcast stage:\n " +
plan.treeString)
+ throw
QueryExecutionErrors.wrongPlanForBroadcastStageError(plan.treeString)
Review comment:
ditto
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]