yashmayya commented on code in PR #13381: URL: https://github.com/apache/pinot/pull/13381#discussion_r1637539965
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/invertedindex/RangeIndexHandler.java: ########## @@ -69,22 +69,31 @@ public boolean needUpdateIndices(SegmentDirectory.Reader segmentReader) { String segmentName = _segmentDirectory.getSegmentMetadata().getName(); Set<String> columnsToAddIdx = new HashSet<>(_columnsToAddIdx); Set<String> existingColumns = segmentReader.toSegmentDirectory().getColumnsWithIndex(StandardIndexes.range()); + + // Check if any index updates are required. + boolean rangeIndexUpdated = false; + // Check if any existing index need to be removed. for (String column : existingColumns) { if (!columnsToAddIdx.remove(column)) { LOGGER.info("Need to remove existing range index from segment: {}, column: {}", segmentName, column); - return true; + rangeIndexUpdated = true; } } - // Check if any new index need to be added. for (String column : columnsToAddIdx) { ColumnMetadata columnMetadata = _segmentDirectory.getSegmentMetadata().getColumnMetadataFor(column); - if (shouldCreateRangeIndex(columnMetadata)) { + if (columnMetadata == null) { + continue; + } Review Comment: It's not quite clear when we'd hit this case but I've retained the existing check. -- 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