HeartSaVioR commented on a change in pull request #35673:
URL: https://github.com/apache/spark/pull/35673#discussion_r826667759



##########
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:
       We create a node with numShufflePartitions = None and replace the value 
in state rule. That said, we can't check the condition before state rule has 
been performed.




-- 
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]

Reply via email to