shounakmk219 commented on code in PR #10757:
URL: https://github.com/apache/pinot/pull/10757#discussion_r1191060536
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java:
##########
@@ -348,6 +353,50 @@ protected Dictionary createIndexReader(PinotDataBuffer
dataBuffer, ColumnMetadat
@Override
protected void handleIndexSpecificCleanup(TableConfig tableConfig) {
IndexingConfig indexingConfig = tableConfig.getIndexingConfig();
+ List<String> noDictionaryColumns = indexingConfig.getNoDictionaryColumns()
== null
+ ? Lists.newArrayList()
+ : indexingConfig.getNoDictionaryColumns();
+ List<FieldConfig> fieldConfigList = tableConfig.getFieldConfigList() ==
null
+ ? Lists.newArrayList()
+ : tableConfig.getFieldConfigList();
+
+ List<FieldConfig> configsToUpdate = new ArrayList<>();
+ for (FieldConfig fieldConfig : fieldConfigList) {
+ // skip further computation of field configs which already has RAW
encodingType
+ if (fieldConfig.getEncodingType() == FieldConfig.EncodingType.RAW) {
+ continue;
+ }
+ // ensure encodingType is RAW on noDictionaryColumns
+ if (noDictionaryColumns.remove(fieldConfig.getName())) {
+ configsToUpdate.add(fieldConfig);
+ }
+ try {
+ DictionaryIndexConfig indexConfig = new ObjectMapper()
+ .treeToValue(fieldConfig.getIndexes().get(getPrettyName()),
DictionaryIndexConfig.class);
+ // ensure encodingType is RAW where dictionary index config has
disabled = true
+ if (indexConfig.isDisabled()) {
+ configsToUpdate.add(fieldConfig);
+ }
+ } catch (JsonProcessingException | NullPointerException ignore) {
Review Comment:
Let me fix this. I was assuming there will never be a
JsonProcessingException exception as the index config is code generated and
purposefully ignored the NPE when there are no indexes.
--
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]