siddharthteotia commented on code in PR #9333:
URL: https://github.com/apache/pinot/pull/9333#discussion_r988651027
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -897,6 +903,40 @@ private static void validateFieldConfigList(@Nullable
List<FieldConfig> fieldCon
}
}
+ /**
+ * Validates the compatibility of the indexes if the column has the forward
index disabled. Throws exceptions due to
+ * compatibility mismatch. The checks performed are:
+ * - Validate dictionary is enabled.
+ * - Validate inverted index is enabled.
+ * - Validate that either no range index exists for column or the range
index version is at least 2 and isn't a
+ * multi-value column (since mulit-value defaults to index v1).
+ */
+ private static void validateForwardIndexDisabledIndexCompatibility(String
columnName, FieldConfig fieldConfig,
+ IndexingConfig indexingConfigs, List<String> noDictionaryColumns, Schema
schema) {
+ Map<String, String> fieldConfigProperties = fieldConfig.getProperties();
+ if (fieldConfigProperties == null) {
+ return;
+ }
+
+ boolean forwardIndexDisabled =
Boolean.parseBoolean(fieldConfigProperties.get(FieldConfig.FORWARD_INDEX_DISABLED));
+ if (!forwardIndexDisabled) {
+ return;
+ }
+
+ FieldSpec fieldSpec = schema.getFieldSpecFor(columnName);
+ Preconditions.checkState(noDictionaryColumns == null ||
!noDictionaryColumns.contains(columnName),
Review Comment:
You should also check that same column has been marked as `RAW` in the
`encodingType` in `FieldConfig` since eventually that will be used alone and
`noDictionaryColumns` will be deprecated at some point after the migration
(hopefully)
--
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]