gortiz commented on code in PR #15904:
URL: https://github.com/apache/pinot/pull/15904#discussion_r2128953986


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -1297,9 +1297,16 @@ private static void validateFieldConfigList(TableConfig 
tableConfig, Schema sche
       validateForwardIndexDisabledIndexCompatibility(columnName, fieldConfig, 
indexingConfig, schema, tableType);
 
       // Validate bloom filter is not added to boolean column
-      if (fieldConfig.getIndexes() != null && 
fieldConfig.getIndexes().has("bloom")) {
-        Preconditions.checkState(fieldSpec.getDataType() != 
FieldSpec.DataType.BOOLEAN,
-          "Cannot create a bloom filter on boolean column " + columnName);
+      if (fieldConfig.getIndexes() != null) {
+        if (fieldConfig.getIndexes().has("bloom")) {
+          Preconditions.checkState(fieldSpec.getDataType() != 
FieldSpec.DataType.BOOLEAN,
+              "Cannot create a bloom filter on boolean column " + columnName);
+        }
+        if (fieldConfig.getIndexes().has("inverted")) {
+          Preconditions.checkState(fieldConfig.getEncodingType() == 
EncodingType.DICTIONARY,
+              "Cannot create inverted index on column: %s, it can only be 
applied to dictionary encoded columns",
+              columnName);
+        }

Review Comment:
   I think it would be a better option to add a `validate` method in the 
IndexType class, so each index can implement its own validations independently.



-- 
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]

Reply via email to