You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/02/12 03:09:13 UTC

[GitHub] [incubator-doris] kangkaisen commented on a change in pull request #2883: add column type check when create bitmap index using create index clause

kangkaisen commented on a change in pull request #2883: add column type check when create bitmap index using create index clause
URL: https://github.com/apache/incubator-doris/pull/2883#discussion_r378019553
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/analysis/IndexDef.java
 ##########
 @@ -118,4 +121,32 @@ public String getComment() {
     public enum IndexType {
         BITMAP,
     }
+    public void checkColumn(Column column) throws AnalysisException {
+        if (indexType == IndexType.BITMAP) {
+            String indexColName = column.getName();
+            PrimitiveType colType = column.getDataType();
+            if (!(colType.isDateType() || colType.isDecimalType() || colType.isFixedPointType() ||
+                          colType.isStringType() || colType == PrimitiveType.BOOLEAN)) {
+                throw new AnalysisException(colType + " is not supported in bitmap index. "
+                        + "invalid column: " + indexColName);
+            } else if (!(column.isKey()
+                                 || column.getAggregationType() == AggregateType.NONE
+                                 || column.getAggregationType() == AggregateType.REPLACE
+                                 || column.getAggregationType() == AggregateType.REPLACE_IF_NOT_NULL)){
+                // althrough the implemention supports bf for replace non-key column,
 
 Review comment:
   `althrough the implemention supports bf for replace non-key column`
   
   What's meaning of `bf`?  This comment seems conflict with `bitmap 索引能够应用在 `Duplicate` 数据模型的所有列和 `Aggregate`, `Uniq` 模型的key列上和 `REPLACE` 的value列上。`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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