shenjiayu17 commented on PR #38534:
URL: https://github.com/apache/spark/pull/38534#issuecomment-1343908559

   Hi @wangyum. I'm very interested in this optimization on partial 
aggregation. But why does it need these child node limit? Do they make some 
influence on function or performance?
   ```
   private[sql] lazy val isAdaptivePartialAggregationEnabled = {
       requiredChildDistributionExpressions.isEmpty && 
groupingAttributes.nonEmpty &&
         conf.adaptivePartialAggregationThreshold > 0 &&
         conf.adaptivePartialAggregationThreshold < (1 << 
conf.fastHashAggregateRowMaxCapacityBit) && {
         child
           .collectUntil(p => p.isInstanceOf[WholeStageCodegenExec] ||
             !p.isInstanceOf[CodegenSupport] ||
             p.isInstanceOf[LeafExecNode]).forall {
           case _: ProjectExec | _: FilterExec | _: ColumnarToRowExec => true
           case _: SerializeFromObjectExec => true
           case _: InputAdapter => true
           // HashAggregateExec, ExpandExec, SortMergeJoinExec ...
           case _ => false
         }
       }
     }
   ```


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