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


##########
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:
   If _should_push_down_value_predicates() is false, predicate on value column 
can not be pushed down to storage layer where index is applied. So it's safe to 
use index on value column. But it's too slow for MATCH query if index is not 
applied, so do not allow inverted index with parser.



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