Github user kumarvishal09 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1917#discussion_r165811773
--- Diff:
integration/spark-common/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
---
@@ -544,7 +544,8 @@ class TableNewProcessor(cm: TableModel) {
val encoders = if (getEncoderFromParent(field)) {
isAggFunPresent =
cm.dataMapRelation.get.get(field).get.aggregateFunction.equalsIgnoreCase("sum")
||
-
cm.dataMapRelation.get.get(field).get.aggregateFunction.equals("avg")
+
cm.dataMapRelation.get.get(field).get.aggregateFunction.equals("avg") ||
+
cm.dataMapRelation.get.get(field).get.aggregateFunction.equals("count")
--- End diff --
This will only fail when it is a dictionary column, so if in maintable
column is dictionary type then only add count to measure column
---