morningman commented on code in PR #13430:
URL: https://github.com/apache/doris/pull/13430#discussion_r1014760552


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/TableIndexes.java:
##########
@@ -56,6 +58,26 @@ public TableIndexes(List<Index> indexes, Map<String, String> 
properties) {
         this.properties = properties;
     }
 
+    private synchronized int incAndGetMaxIndexUniqueId() {

Review Comment:
   Oh, there is still a problem to use `maxIndexId` inside `TableIndexes`.
   For example, after `add index`, there will be an edit log, and after FE 
restart, it will replay that edit log, but it didn't update the `maxIndexId` in 
`TableIndexes`.



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Index.java:
##########
@@ -84,6 +104,36 @@ public void setIndexType(IndexDef.IndexType indexType) {
         this.indexType = indexType;
     }
 
+    public Map<String, String> getProperties() {
+        return properties;
+    }
+
+    public void setProperties(Map<String, String> properties) {
+        this.properties = properties;
+    }
+
+    public String getPropertiesString() {
+        if (properties == null || properties.isEmpty()) {

Review Comment:
   you can use `PrintableMap` to do this.



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/IndexDef.java:
##########
@@ -48,12 +52,18 @@ public IndexDef(String indexName, boolean ifNotExists, 
List<String> columns, Ind
         } else {
             this.comment = comment;
         }
+        if (properties == null) {
+            this.properties = new HashMap<>();
+        } else {
+            this.properties = properties;
+        }
     }
 
     public void analyze() throws AnalysisException {
-        if (indexType == IndexDef.IndexType.BITMAP) {
+        if (indexType == IndexDef.IndexType.BITMAP
+                || indexType == IndexDef.IndexType.INVERTED) {

Review Comment:
   I think we can also add `BLOOM_FILTER` check this time, although it is not 
implemented yet.



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/IndexDef.java:
##########
@@ -126,29 +153,37 @@ public boolean isSetIfNotExists() {
 
     public enum IndexType {
         BITMAP,
+        INVERTED,
+    }
 
+    public boolean isInvertedIndex() {
+        return (this.indexType == IndexType.INVERTED);
     }
 
     public void checkColumn(Column column, KeysType keysType) throws 
AnalysisException {
-        if (indexType == IndexType.BITMAP) {
+        if (indexType == IndexType.BITMAP || indexType == IndexType.INVERTED) {

Review Comment:
   I think we can also add `BLOOM_FILTER` check this time, although it is not 
implemented yet.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to