siddharthteotia commented on code in PR #9810: URL: https://github.com/apache/pinot/pull/9810#discussion_r1038884447
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/ForwardIndexHandler.java: ########## @@ -136,11 +139,28 @@ public void updateIndices(SegmentDirectory.Writer segmentWriter, IndexCreatorPro // forward index here which is dictionary based and allow the post deletion step handle the actual deletion // of the forward index. createDictBasedForwardIndex(column, segmentWriter, indexCreatorProvider); - Preconditions.checkState(segmentWriter.hasIndexFor(column, ColumnIndexType.FORWARD_INDEX), - String.format("Temporary forward index was not created for column: %s", column)); + if (!segmentWriter.hasIndexFor(column, ColumnIndexType.FORWARD_INDEX)) { + throw new IOException(String.format("Temporary forward index was not created for column: %s", column)); + } _forwardIndexDisabledColumnsToCleanup.add(column); break; } + case ENABLE_FORWARD_INDEX_FOR_DICT_COLUMN: { + createForwardIndexIfNeeded(segmentWriter, _segmentMetadata.getColumnMetadataFor(column), indexCreatorProvider, + false); + if (!segmentWriter.hasIndexFor(column, ColumnIndexType.DICTIONARY)) { + throw new IOException(String.format("Dictionary is not present for dictionary based column: %s", column)); + } + break; + } + case ENABLE_FORWARD_INDEX_FOR_RAW_COLUMN: { + createForwardIndexIfNeeded(segmentWriter, _segmentMetadata.getColumnMetadataFor(column), indexCreatorProvider, + false); + if (segmentWriter.hasIndexFor(column, ColumnIndexType.DICTIONARY)) { + throw new IOException(String.format("Dictionary is still present for noDictionary column: %s", column)); Review Comment: Suggest changing to `"Dictionary should have been deleted after rebuilding fwd index for raw column"` -- 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