gortiz commented on code in PR #12223: URL: https://github.com/apache/pinot/pull/12223#discussion_r1445858108
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java: ########## @@ -107,11 +116,15 @@ public Map<String, DictionaryIndexConfig> fromIndexLoadingConfig( Set<String> noDictionaryCols = indexLoadingConfig.getNoDictionaryColumns(); Set<String> onHeapCols = indexLoadingConfig.getOnHeapDictionaryColumns(); Set<String> varLengthCols = indexLoadingConfig.getVarLengthDictionaryColumns(); + Map<String, OnHeapDictionaryConfig> onHeapDictionaryConfigs = indexLoadingConfig.getOnHeapDictionaryConfigs(); for (String column : indexLoadingConfig.getAllKnownColumns()) { if (noDictionaryCols.contains(column)) { result.put(column, DictionaryIndexConfig.disabled()); } else { - result.put(column, new DictionaryIndexConfig(onHeapCols.contains(column), varLengthCols.contains(column))); + boolean loadOnHeap = onHeapCols.contains(column); + OnHeapDictionaryConfig onHeapConfig = loadOnHeap ? onHeapDictionaryConfigs.get(column) : null; + result.put(column, + new DictionaryIndexConfig(onHeapCols.contains(column), varLengthCols.contains(column), onHeapConfig)); Review Comment: As said in IndexingConfig comment, I recommend to do not support this feature using the old syntax. By doing so we won't need to modify this part of the code. ########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java: ########## @@ -162,10 +175,14 @@ public ColumnConfigDeserializer<DictionaryIndexConfig> createDeserializer() { Set<String> varLength = new HashSet<>( ic.getVarLengthDictionaryColumns() == null ? Collections.emptyList() : ic.getVarLengthDictionaryColumns() ); + Map<String, OnHeapDictionaryConfig> onHeapDictConfigMap = new HashMap<>( + ic.getOnHeapDictionaryConfigs() == null ? Collections.emptyMap() : ic.getOnHeapDictionaryConfigs() + ); + Function<String, DictionaryIndexConfig> valueCalculator = - column -> new DictionaryIndexConfig(onHeap.contains(column), varLength.contains(column)); - return Sets.union(onHeap, varLength).stream() - .collect(Collectors.toMap(Function.identity(), valueCalculator)); + column -> new DictionaryIndexConfig(onHeap.contains(column), varLength.contains(column), + onHeapDictConfigMap.get(column)); + return Sets.union(onHeap, varLength).stream().collect(Collectors.toMap(Function.identity(), valueCalculator)); Review Comment: As said in IndexingConfig comment, I recommend to do not support this feature using the old syntax. By doing so we won't need to modify this part of the code. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org