You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/15 07:55:54 UTC
[GitHub] [spark] LuciferYang commented on a change in pull request #35673: [SPARK-38204][SS] Use StatefulOpClusteredDistribution for stateful operators with respecting backward compatibility
LuciferYang commented on a change in pull request #35673:
URL: https://github.com/apache/spark/pull/35673#discussion_r826671421
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/BaseAggregateExec.scala
##########
@@ -92,7 +95,20 @@ trait BaseAggregateExec extends UnaryExecNode with AliasAwareOutputPartitioning
override def requiredChildDistribution: List[Distribution] = {
requiredChildDistributionExpressions match {
case Some(exprs) if exprs.isEmpty => AllTuples :: Nil
- case Some(exprs) => ClusteredDistribution(exprs) :: Nil
+ case Some(exprs) =>
+ if (isStreaming) {
+ numShufflePartitions match {
+ case Some(parts) =>
+ StatefulOperatorPartitioning.getClusteredDistributionWithBackwardCompatibility(
+ exprs, parts, conf) :: Nil
+
+ case _ =>
+ throw new IllegalStateException("Expected to set the number of partitions before " +
Review comment:
Maybe we should use the new error framework to throw exception in newly added code.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org