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

    https://github.com/apache/carbondata/pull/1446#discussion_r150406325
  
    --- Diff: 
integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonAnalysisRules.scala
 ---
    @@ -67,16 +76,54 @@ object CarbonPreInsertionCasts extends 
Rule[LogicalPlan] {
               case attr => attr
             }
           }
    -      val newChild: LogicalPlan = if (newChildOutput == child.output) {
    +      val newChild: LogicalPlan = if (newChildOutput == childPlan.output) {
             p.child
           } else {
    -        Project(newChildOutput, child)
    +        Project(newChildOutput, childPlan)
           }
           InsertIntoCarbonTable(relation, p.partition, newChild, p.overwrite, 
p.ifNotExists)
         } else {
           sys.error("Cannot insert into target table because column number are 
different")
         }
       }
    +
    +  /**
    +   * Transform the logical plan with average(col1) aggregation type to 
sum(col1) and count(col1).
    +   *
    +   * @param logicalPlan
    +   * @return
    +   */
    +  private def transformAggregatePlan(logicalPlan: LogicalPlan): 
LogicalPlan = {
    --- End diff --
    
    This needs to be moved preaggregate analysis rules, anyway, we can move it 
in query PR. That PR already has separate class


---

Reply via email to