Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1464#discussion_r148992553
--- Diff:
core/src/main/java/org/apache/carbondata/core/metadata/schema/table/DataMapSchema.java
---
@@ -67,6 +92,83 @@ public void setRelationIdentifier(RelationIdentifier
relationIdentifier) {
public void setChildSchema(TableSchema childSchema) {
this.childSchema = childSchema;
+ List<ColumnSchema> listOfColumns = this.childSchema.getListOfColumns();
+ fillNonAggFunctionColumns(listOfColumns);
+ fillAggFunctionColumns(listOfColumns);
+ fillParentNameToAggregationMapping(listOfColumns);
+ }
+
+ /**
+ * Method to prepare mapping of parent to list of aggregation function
applied on that column
+ * @param listOfColumns
+ * child column schema list
+ */
+ private void fillParentNameToAggregationMapping(List<ColumnSchema>
listOfColumns) {
+ parentColumnToAggregationsMapping = new HashMap<>();
+ for (ColumnSchema column : listOfColumns) {
+ if (null != column.getAggFunction() &&
!column.getAggFunction().isEmpty()) {
+ List<ParentColumnTableRelation> parentColumnTableRelations =
+ column.getParentColumnTableRelations();
+ if (null != parentColumnTableRelations) {
--- End diff --
Please check the size of this list as well or iterate the list instead of
always getting from 0 element.
---