somandal commented on code in PR #9740:
URL: https://github.com/apache/pinot/pull/9740#discussion_r1015952770
##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/ForwardIndexHandlerTest.java:
##########
@@ -477,7 +669,13 @@ public void testRewriteRawForwardIndexForSingleColumn()
SegmentDirectory.Writer writer =
segmentLocalFSDirectory.createWriter();
List<FieldConfig> fieldConfigs = new
ArrayList<>(_tableConfig.getFieldConfigList());
- FieldConfig config = fieldConfigs.remove(i);
+ int index = -1;
+ for (int j = 0; j < fieldConfigs.size(); j++) {
+ if
(fieldConfigs.get(j).getName().equals(_noDictionaryColumns.get(i))) {
+ index = j;
Review Comment:
done
##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/ForwardIndexHandlerTest.java:
##########
@@ -460,11 +538,125 @@ public void testComputeOperation()
assertEquals(operationMap.get(config1.getName()),
ForwardIndexHandler.Operation.CHANGE_RAW_INDEX_COMPRESSION_TYPE);
assertEquals(operationMap.get(config2.getName()),
ForwardIndexHandler.Operation.CHANGE_RAW_INDEX_COMPRESSION_TYPE);
+ // TEST10: Disable forward index for a column which already has forward
index disabled
+ indexLoadingConfig = new IndexLoadingConfig(null, _tableConfig);
+
indexLoadingConfig.getForwardIndexDisabledColumns().add(DIM_SV_FORWARD_INDEX_DISABLED_INTEGER);
+ fwdIndexHandler = new ForwardIndexHandler(existingSegmentMetadata,
indexLoadingConfig, null);
+ operationMap = fwdIndexHandler.computeOperation(writer);
+ assertEquals(operationMap, Collections.EMPTY_MAP);
+
+ // TEST11: Disable forward index for a dictionary column with forward
index enabled
+ indexLoadingConfig = new IndexLoadingConfig(null, _tableConfig);
+ indexLoadingConfig.getForwardIndexDisabledColumns().add(DIM_DICT_INTEGER);
+ indexLoadingConfig.getInvertedIndexColumns().add(DIM_DICT_INTEGER);
+ fwdIndexHandler = new ForwardIndexHandler(existingSegmentMetadata,
indexLoadingConfig, _schema);
+ operationMap = fwdIndexHandler.computeOperation(writer);
+ assertEquals(operationMap.size(), 1);
+ assertEquals(operationMap.get(DIM_DICT_INTEGER),
ForwardIndexHandler.Operation.DELETE_FORWARD_INDEX);
+
+ // TEST12: Disable forward index for a dictionary column with forward
index enabled, disable dictionary
+ indexLoadingConfig = new IndexLoadingConfig(null, _tableConfig);
+ indexLoadingConfig.getForwardIndexDisabledColumns().add(DIM_LZ4_BYTES);
+ indexLoadingConfig.getNoDictionaryColumns().add(DIM_LZ4_BYTES);
+ indexLoadingConfig.getInvertedIndexColumns().add(DIM_LZ4_BYTES);
+ fwdIndexHandler = new ForwardIndexHandler(existingSegmentMetadata,
indexLoadingConfig, _schema);
+ ForwardIndexHandler finalFwdIndexHandler = fwdIndexHandler;
+ assertThrows(IllegalStateException.class, () ->
finalFwdIndexHandler.computeOperation(writer));
+
+ // TEST13: Disable forward index for a raw column with forward index
enabled and enable dictionary
Review Comment:
done
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/bloomfilter/BloomFilterHandler.java:
##########
@@ -111,6 +111,11 @@ public void updateIndices(SegmentDirectory.Writer
segmentWriter, IndexCreatorPro
}
}
+ @Override
+ public void postUpdateIndicesCleanup(SegmentDirectory.Writer segmentWriter)
Review Comment:
done
--
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]