icefury71 commented on a change in pull request #6017: URL: https://github.com/apache/incubator-pinot/pull/6017#discussion_r490664421
########## File path: pinot-core/src/main/java/org/apache/pinot/core/util/TableConfigUtils.java ########## @@ -225,4 +233,99 @@ private static void validateTierConfigList(@Nullable List<TierConfig> tierConfig } } } + + /** + * Validates the Indexing Config + * Ensures that every referred column name exists in the corresponding schema + */ + private static void validateIndexingConfig(@Nullable IndexingConfig indexingConfig, @Nullable Schema schema) { + if (indexingConfig == null || schema == null) { + return; + } + Map<String, String> columnNameToConfigMap = new HashMap<>(); + + if (indexingConfig.getBloomFilterColumns() != null) { + for (String columnName : indexingConfig.getBloomFilterColumns()) { + columnNameToConfigMap.put(columnName, "Bloom Filter Config"); + } + } + if (indexingConfig.getInvertedIndexColumns() != null) { + for (String columnName : indexingConfig.getInvertedIndexColumns()) { + columnNameToConfigMap.put(columnName, "Inverted Index Config"); + } + } + if (indexingConfig.getNoDictionaryColumns() != null) { + for (String columnName : indexingConfig.getNoDictionaryColumns()) { + columnNameToConfigMap.put(columnName, "No Dictionary Column Config"); + } + } + if (indexingConfig.getOnHeapDictionaryColumns() != null) { + for (String columnName : indexingConfig.getOnHeapDictionaryColumns()) { + columnNameToConfigMap.put(columnName, "On Heap Dictionary Column Config"); + } + } + if (indexingConfig.getRangeIndexColumns() != null) { + for (String columnName : indexingConfig.getRangeIndexColumns()) { + columnNameToConfigMap.put(columnName, "Range Column Config"); + } + } + if (indexingConfig.getSortedColumn() != null) { + for (String columnName : indexingConfig.getSortedColumn()) { + columnNameToConfigMap.put(columnName, "Sorted Column Config"); + } + } + if (indexingConfig.getVarLengthDictionaryColumns() != null) { + for (String columnName : indexingConfig.getVarLengthDictionaryColumns()) { + columnNameToConfigMap.put(columnName, "Var Length Column Config"); + } + } + List<StarTreeIndexConfig> starTreeIndexConfigList = indexingConfig.getStarTreeIndexConfigs(); + if (starTreeIndexConfigList != null) { + for (StarTreeIndexConfig starTreeIndexConfig : starTreeIndexConfigList) { + // Dimension split order cannot be null + for (String columnName : starTreeIndexConfig.getDimensionsSplitOrder()) { + columnNameToConfigMap.put(columnName, "StarTreeIndex Config"); + } + // Function column pairs cannot be null + for (String functionColumnPair : starTreeIndexConfig.getFunctionColumnPairs()) { + String[] functionColumnArray = functionColumnPair.split("__"); Review comment: Done ---------------------------------------------------------------- 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. 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