kangpinghuang commented on a change in pull request #1917: Support specifying inverted index columns when creating table URL: https://github.com/apache/incubator-doris/pull/1917#discussion_r350602783
########## File path: fe/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java ########## @@ -371,4 +377,38 @@ public static long analyzeTimeout(Map<String, String> properties, long defaultTi } return timeout; } + + public static Set<String> analyzeInvertedIndex(Map<String, String> properties, + List<Column> columns) throws AnalysisException { + if (properties == null || !properties.containsKey(PROPERTIES_INVERTED_INDEX_COLUMNS)) { + return Sets.newHashSet(); + } + String idxColsStr = properties.get(PROPERTIES_INVERTED_INDEX_COLUMNS); + properties.remove(PROPERTIES_INVERTED_INDEX_COLUMNS); + if (Strings.isNullOrEmpty(idxColsStr)) { + return Sets.newHashSet(); + } + Set<String> resultCols = Sets.newHashSet(); + Map<String, Column> columnMap = columns.stream() + .collect(Collectors.toMap(col -> col.getName().toLowerCase(), Function.identity())); + + List<String> idxCols = COMMA_SPLITTER.splitToList(idxColsStr.toLowerCase()); + for (String idxCol : idxCols) { + if (columnMap.containsKey(idxCol)) { + Column column = columnMap.get(idxCol); + if (column.isKey()) { Review comment: here, if the table is a agg table, inverted index can only be used in key columns, not value columns; if the table is duplicate table, inverted index can be used in both key and value; if the table is unique table, inverted index can only be used in key column. ---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org