cloud-fan commented on a change in pull request #31920:
URL: https://github.com/apache/spark/pull/31920#discussion_r611449388
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala
##########
@@ -53,8 +54,8 @@ class SQLMetric(val metricType: String, initValue: Long = 0L)
extends Accumulato
case o: SQLMetric =>
if (_value < 0) _value = 0
if (o.value > 0) _value += o.value
- case _ => throw new UnsupportedOperationException(
- s"Cannot merge ${this.getClass.getName} with ${other.getClass.getName}")
+ case _ => throw
QueryExecutionErrors.cannotMergeSQLMetricWithAccumulatorV2Error(
Review comment:
ditto
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala
##########
@@ -200,7 +201,7 @@ object SQLMetrics {
} else if (metricsType == NS_TIMING_METRIC) {
duration => Utils.msDurationToString(duration.nanos.toMillis)
} else {
- throw new IllegalStateException("unexpected metrics type: " +
metricsType)
+ throw QueryExecutionErrors.unexpectedMetricsTypeError(metricsType)
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]