carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipesala <...@git.apache.org>
Subject [GitHub] carbondata pull request #1671: [CARBONDATA-1901]Fixed Pre aggregate data map...
Date Sat, 16 Dec 2017 08:18:16 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1671#discussion_r157337178
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
---
    @@ -514,17 +514,40 @@ class TableNewProcessor(cm: TableModel) {
         }
     
         cm.msrCols.foreach { field =>
    -      val encoders = new java.util.ArrayList[Encoding]()
    +      // if aggregate function is defined in case of preaggregate and agg function is
sum or avg
    +      // then it can be stored as measure
    +      var isAggFunPresent = false
    +      // getting the encoder from maintable so whatever encoding is applied in maintable
    +      // same encoder can be applied on aggregate table
    +      val encoders = if (cm.parentTable.isDefined && cm.dataMapRelation.get.get(field).isDefined)
{
    +        isAggFunPresent =
    +          cm.dataMapRelation.get.get(field).get.aggregateFunction.equalsIgnoreCase("sum")
||
    +          cm.dataMapRelation.get.get(field).get.aggregateFunction.equals("avg")
    --- End diff --
    
    How about count aggregate?


---

Mime
View raw message