Github user ravipesala commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2109#discussion_r178222584 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateTableHelper.scala --- @@ -59,8 +60,22 @@ case class PreAggregateTableHelper( val df = sparkSession.sql(updatedQuery) val fieldRelationMap = PreAggregateUtil.validateActualSelectPlanAndGetAttributes( df.logicalPlan, queryString) + val partitionInfo = parentTable.getPartitionInfo val fields = fieldRelationMap.keySet.toSeq val tableProperties = mutable.Map[String, String]() + val childPartitionColumns = if (partitionInfo != null && + partitionInfo.getPartitionType == PartitionType.NATIVE_HIVE) { + val parentPartitionColumns = partitionInfo.getColumnSchemaList.asScala.map(_.getColumnName) + PreAggregateUtil + .extractPartitionInfoForAggregateTable(df.logicalPlan, parentPartitionColumns) + } else {Seq()} --- End diff -- format it properly
---