siddharthteotia commented on code in PR #9678:
URL: https://github.com/apache/pinot/pull/9678#discussion_r1011073256
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/SegmentPreProcessor.java:
##########
@@ -104,8 +104,15 @@ public void process()
// Update single-column indices, like inverted index, json index etc.
IndexCreatorProvider indexCreatorProvider =
IndexingOverrides.getIndexCreatorProvider();
for (ColumnIndexType type : ColumnIndexType.values()) {
- IndexHandler handler = IndexHandlerFactory.getIndexHandler(type,
_segmentMetadata, _indexLoadingConfig);
+ IndexHandler handler =
+ IndexHandlerFactory.getIndexHandler(type, _segmentMetadata,
_indexLoadingConfig, _schema);
handler.updateIndices(segmentWriter, indexCreatorProvider);
+ if (type == ColumnIndexType.FORWARD_INDEX) {
Review Comment:
Rather than relying on ColumnIndexType enum entry order, I feel this code
should explicitly ensure that FORWARD_INDEX handler is the first handler to be
invoked and then everyone else in the loop
We have seen cases (in the recent past) where either people disregarded or
just simply forgot to honor the javadoc guideline regarding enum entry order.
So, code should be more resilient against such cases
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/SegmentPreProcessor.java:
##########
@@ -104,8 +104,15 @@ public void process()
// Update single-column indices, like inverted index, json index etc.
IndexCreatorProvider indexCreatorProvider =
IndexingOverrides.getIndexCreatorProvider();
for (ColumnIndexType type : ColumnIndexType.values()) {
- IndexHandler handler = IndexHandlerFactory.getIndexHandler(type,
_segmentMetadata, _indexLoadingConfig);
+ IndexHandler handler =
+ IndexHandlerFactory.getIndexHandler(type, _segmentMetadata,
_indexLoadingConfig, _schema);
handler.updateIndices(segmentWriter, indexCreatorProvider);
+ if (type == ColumnIndexType.FORWARD_INDEX) {
Review Comment:
Rather than relying on `ColumnIndexType` enum entry order, I feel this code
should explicitly ensure that `FORWARD_INDEX` handler is the first handler to
be invoked and then everyone else in the loop
We have seen cases (in the recent past) where either people disregarded or
just simply forgot to honor the javadoc guideline regarding enum entry order.
So, code should be more resilient against such cases
--
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]