Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13286#discussion_r64496407
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/IncrementalExecution.scala
 ---
    @@ -35,15 +35,36 @@ class IncrementalExecution private[sql](
         val currentBatchId: Long)
       extends QueryExecution(sparkSession, logicalPlan) {
     
    -  // TODO: make this always part of planning.
    -  val stateStrategy = 
sparkSession.sessionState.planner.StatefulAggregationStrategy :: Nil
    -
       // Modified planner with stateful operations.
       override def planner: SparkPlanner =
         new SparkPlanner(
           sparkSession.sparkContext,
           sparkSession.sessionState.conf,
    -      stateStrategy)
    +      Nil) {
    +
    +      override def strategies: Seq[Strategy] = {
    +        StatefulAggregationStrategy +: super.strategies
    +      }
    +
    +      /**
    +       * Used to plan aggregation queries that are computed incrementally 
as part of a
    +       * [[org.apache.spark.sql.ContinuousQuery]].
    +       */
    +      object StatefulAggregationStrategy extends Strategy {
    +        override def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match 
{
    +          case PhysicalAggregation(
    +            namedGroupingExpressions, aggregateExpressions, 
rewrittenResultExpressions, child) =>
    +            execution.aggregate.Utils.planStreamingAggregation(
    +              namedGroupingExpressions,
    +              aggregateExpressions,
    +              rewrittenResultExpressions,
    +              outputMode,
    --- End diff --
    
    Nvm. I simplified the logic even further to avoid this refactoring. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to