Github user kunal642 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2172#discussion_r183012262
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateTableHelper.scala
---
@@ -73,18 +74,9 @@ case class PreAggregateTableHelper(
Seq()
}
// Generate child table partition columns in the same order as the
parent table.
- val partitionerFields = fieldRelationMap.collect {
- case (field, dataMapField) if parentPartitionColumns
- .exists(parentCol =>
- /* For count(*) while Pre-Aggregate table
creation,columnTableRelationList was null */
- dataMapField.columnTableRelationList.getOrElse(Seq()).nonEmpty &&
-
parentCol.equals(dataMapField.columnTableRelationList.get.head.parentColumnName)
&&
- dataMapField.aggregateFunction.isEmpty) =>
- (PartitionerField(field.name.get,
- field.dataType,
- field.columnComment), parentPartitionColumns
-
.indexOf(dataMapField.columnTableRelationList.get.head.parentColumnName))
- }.toSeq.sortBy(_._2).map(_._1)
+ val partitionerFields =
+ PartitionUtils.getPartitionerFields(parentPartitionColumns,
fieldRelationMap)
--- End diff --
fixed
---