somandal commented on code in PR #9740:
URL: https://github.com/apache/pinot/pull/9740#discussion_r1015902321
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/ForwardIndexHandler.java:
##########
@@ -62,34 +62,42 @@
import static
org.apache.pinot.segment.spi.V1Constants.MetadataKeys.Column.DICTIONARY_ELEMENT_SIZE;
import static
org.apache.pinot.segment.spi.V1Constants.MetadataKeys.Column.HAS_DICTIONARY;
import static
org.apache.pinot.segment.spi.V1Constants.MetadataKeys.Column.getKeyFor;
+
+
/**
* Helper class used by {@link SegmentPreProcessor} to make changes to forward
index and dictionary configs. Note
* that this handler only works for segment versions >= 3.0. Support for
segment version < 3.0 is not added because
* majority of the usecases are in versions >= 3.0 and this avoids adding tech
debt. The currently supported
* operations are:
* 1. Change compression on raw SV and MV columns.
+ * 2. Disable forward index on a column where it is enabled
*
* TODO: Add support for the following:
* 1. Disable dictionary
* 2. Segment versions < V3
+ * 3. Support enabling forward index on a forward index disabled column
*/
public class ForwardIndexHandler implements IndexHandler {
private static final Logger LOGGER =
LoggerFactory.getLogger(ForwardIndexHandler.class);
private final SegmentMetadata _segmentMetadata;
- IndexLoadingConfig _indexLoadingConfig;
- Schema _schema;
+ private final IndexLoadingConfig _indexLoadingConfig;
+ private final Schema _schema;
+ private final Set<String> _forwardIndexDisabledColumnsToCleanup;
protected enum Operation {
- // TODO: Add other operations like DISABLE_DICTIONARY,
+ // TODO: Add other operations like DISABLE_DICTIONARY, ADD_FORWARD_INDEX,
ADD_RAW_FORWARD_INDEX
CHANGE_RAW_INDEX_COMPRESSION_TYPE,
- ENABLE_DICTIONARY
+ ENABLE_DICTIONARY,
+ DELETE_FORWARD_INDEX,
Review Comment:
good suggestion, sometimes I'm terrible at naming (and this was one of the
worst names I could have picked, I was shaking my head but had a brain freeze
and couldn't think of anything better).
I think it still makes sense to keep the two operations separate so I'll
take your suggestion to use "DISABLE_FORWARD_INDEX_FOR_RAW_COL" and
"DISABLE_FORWARD_INDEX_FOR_DICT_COL"
--
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]