Github user kumarvishal09 commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1694#discussion_r158948738 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateUtil.scala --- @@ -126,19 +126,33 @@ object PreAggregateUtil { attr.aggregateFunction, parentTableName, parentDatabaseName, - parentTableId) + parentTableId, + "column_" + counter) + counter = counter + 1 case attr: AttributeReference => + val columnRelation = getColumnRelation(attr.name, + parentTableId, + parentTableName, + parentDatabaseName, + carbonTable) + val arrayBuffer = new ArrayBuffer[ColumnTableRelation]() + arrayBuffer += columnRelation fieldToDataMapFieldMap += getField(attr.name, attr.dataType, - parentColumnId = carbonTable.getColumnByName(parentTableName, attr.name).getColumnId, parentTableName = parentTableName, - parentDatabaseName = parentDatabaseName, parentTableId = parentTableId) + columnTableRelationList = arrayBuffer.toList) case Alias(attr: AttributeReference, _) => + val columnRelation = getColumnRelation(attr.name, + parentTableId, + parentTableName, + parentDatabaseName, + carbonTable) + val arrayBuffer = new ArrayBuffer[ColumnTableRelation]() --- End diff -- fixed
---