gortiz commented on code in PR #12464:
URL: https://github.com/apache/pinot/pull/12464#discussion_r1500325084


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -490,6 +493,19 @@ public static void validateIngestionConfig(TableConfig 
tableConfig, @Nullable Sc
           Preconditions.checkState(new 
HashSet<>(schema.getMetricNames()).equals(aggregationColumns),
               "all metric columns must be aggregated");
         }
+
+        // This is required by 
MutableSegmentImpl.enableMetricsAggregationIfPossible().
+        // That code will disable ingestion aggregation if all metrics aren't 
noDictionaryColumns.
+        // But if you do that after the table is already created, all future 
aggregations will
+        // just be the default value.
+        Map<String, FieldIndexConfigs> fieldIndexConfigsMap = 
FieldIndexConfigsUtil.createIndexConfigsByColName(

Review Comment:
   As far as I know there is none. But in this case we can directly call 
`StandardIndexes.dictionary().getConfig(tableConfig, schema)`.
   
   Specifically we could change this code to do something like:
   
   ```java
          Map<String, DictionaryIndexConfig> configPerCol = 
StandardIndexes.dictionary().getConfig(tableConfig, schema);
           aggregationColumns.forEach(column -> {
             DictionaryIndexConfig dictConfig = configPerCol.get(column);
             Preconditions.checkState(dictConfig != null && 
dictConfig.isEnabled(),
               "Aggregated column: %s must be a no-dictionary column", column);
             });
           }
   ```
   
   `FieldIndexConfigsUtil.createIndexConfigsByColName` is designed to be used 
when we need to calculate the indexes for all columns and it includes a 
deserializer in order to optionally alter the way index configs are read (which 
is necessary in order to use IndexLoadingConfig in tests)



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to