Jackie-Jiang commented on a change in pull request #4870: Add 
getResultColumnName API to AggregationFunction to fetch sql compliant result 
name
URL: https://github.com/apache/incubator-pinot/pull/4870#discussion_r351507818
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/data/table/TableResizer.java
 ##########
 @@ -57,15 +57,18 @@
     int numAggregations = aggregationInfos.size();
     int numKeyColumns = numColumns - numAggregations;
 
+    int aggIdx = 0;
     Map<String, Integer> columnIndexMap = new HashMap<>();
+    Map<String, AggregationFunction> aggregationColumnToFunction = new 
HashMap<>();
     for (int i = 0; i < numColumns; i++) {
-      columnIndexMap.put(dataSchema.getColumnName(i), i);
-    }
-
-    Map<String, AggregationInfo> aggregationColumnToInfo = new HashMap<>();
-    for (AggregationInfo aggregationInfo : aggregationInfos) {
-      String aggregationColumn = 
AggregationFunctionUtils.getAggregationColumnName(aggregationInfo);
-      aggregationColumnToInfo.put(aggregationColumn, aggregationInfo);
+      String columnName = dataSchema.getColumnName(i).toLowerCase();
+      columnIndexMap.put(columnName, i);
+      if (i >= numKeyColumns) {
+        AggregationFunction aggregationFunction =
 
 Review comment:
   Please add some comments here (key columns are in front of aggregation 
columns).
   Also, `aggIdx === i - numKeyColumns`, so you don't need to maintain another 
index.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to