xiaokang commented on code in PR #31051:
URL: https://github.com/apache/doris/pull/31051#discussion_r1493948614


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/IndexDef.java:
##########
@@ -224,12 +224,16 @@ public void checkColumn(Column column, KeysType keysType, 
boolean enableUniqueKe
                 throw new AnalysisException(colType + " is not supported in " 
+ indexType.toString() + " index. "
                         + "invalid index: " + indexName);
             }
-            if (!column.isKey()
-                    && ((keysType == KeysType.UNIQUE_KEYS && 
!enableUniqueKeyMergeOnWrite)
-                        || keysType == KeysType.AGG_KEYS)) {
-                throw new AnalysisException(indexType.toString()
-                    + " index only used in columns of DUP_KEYS/UNIQUE_KEYS MOW 
table or key columns of all table."
-                    + " invalid index: " + indexName);
+            if (!column.isKey()) {
+                if (keysType == KeysType.AGG_KEYS) {
+                    throw new AnalysisException("index should only be used in 
columns of DUP_KEYS/UNIQUE_KEYS table"
+                        + " or key columns of AGG_KEYS table. invalid index: " 
+ indexName);
+                } else if (keysType == KeysType.UNIQUE_KEYS && 
!enableUniqueKeyMergeOnWrite
+                               && indexType == IndexType.INVERTED && 
properties != null

Review Comment:
   I checked 



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/IndexDef.java:
##########
@@ -224,12 +224,16 @@ public void checkColumn(Column column, KeysType keysType, 
boolean enableUniqueKe
                 throw new AnalysisException(colType + " is not supported in " 
+ indexType.toString() + " index. "
                         + "invalid index: " + indexName);
             }
-            if (!column.isKey()
-                    && ((keysType == KeysType.UNIQUE_KEYS && 
!enableUniqueKeyMergeOnWrite)
-                        || keysType == KeysType.AGG_KEYS)) {
-                throw new AnalysisException(indexType.toString()
-                    + " index only used in columns of DUP_KEYS/UNIQUE_KEYS MOW 
table or key columns of all table."
-                    + " invalid index: " + indexName);
+            if (!column.isKey()) {
+                if (keysType == KeysType.AGG_KEYS) {
+                    throw new AnalysisException("index should only be used in 
columns of DUP_KEYS/UNIQUE_KEYS table"
+                        + " or key columns of AGG_KEYS table. invalid index: " 
+ indexName);
+                } else if (keysType == KeysType.UNIQUE_KEYS && 
!enableUniqueKeyMergeOnWrite
+                               && indexType == IndexType.INVERTED && 
properties != null

Review Comment:
   I checked 



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