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

    https://github.com/apache/carbondata/pull/2083#discussion_r177004129
  
    --- Diff: 
integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonPreAggregateRules.scala
 ---
    @@ -475,6 +603,25 @@ case class CarbonPreAggregateQueryRules(sparkSession: 
SparkSession) extends Rule
                           CarbonReflectionUtils
                             .getSubqueryAlias(sparkSession, Some(alias2), 
newChild, None),
                           None)))
    +              if(carbonTable.isStreamingTable) {
    +                setSegmentsForStreaming(carbonTable, aggDataMapSchema)
    +                // get new fact expression
    +                val factExp = updateFactTablePlanForStreaming(agg)
    +                // get new Aggregate node expression
    +                val streamingNodeExp = getExpressionsForStreaming(aggExp)
    +                // clear the expression as in case of streaming it is not 
required
    +                updatedExpression.clear
    +                // Add Aggregate node to aggregate data from fact and 
aggregate
    +                Aggregate(
    +                  grExp,
    +                  streamingNodeExp.asInstanceOf[Seq[NamedExpression]],
    +                  // add union node to get the result from both
    +                  Union(
    +                    factExp,
    +                    updateAggPlan))
    +              } else {
    +                updateAggPlan
    +              }
    --- End diff --
    
    ok


---

Reply via email to