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/05/22 09:58:36 UTC

[GitHub] [incubator-doris] HangyuanLiu commented on a change in pull request #3651: Support create materialized view with bitmap or hll

HangyuanLiu commented on a change in pull request #3651:
URL: https://github.com/apache/incubator-doris/pull/3651#discussion_r429155817



##########
File path: fe/src/main/java/org/apache/doris/alter/MaterializedViewHandler.java
##########
@@ -457,8 +462,23 @@ private RollupJobV2 createMaterializedViewJob(String mvName, String baseIndexNam
                                                + "duplicate table");
             }
             Column newMVColumn = new Column(baseColumn);
+
             newMVColumn.setIsKey(mvColumnItem.isKey());
             newMVColumn.setAggregationType(mvAggregationType, mvColumnItem.isAggregationTypeImplicit());
+            newMVColumn.setDefineExpr(mvColumnItem.getDefineExpr());
+            if (mvColumnItem.getDefineExpr() != null) {
+                if (mvAggregationType.equals(BITMAP_UNION)) {
+                    newMVColumn.setType(Type.BITMAP);
+                    newMVColumn.setName(MATERIALIZED_VIEW_NAME_PRFIX + "bitmap_" + baseColumn.getName());
+                } else if (mvAggregationType.equals(HLL_UNION)){
+                    newMVColumn.setType(Type.HLL);
+                    newMVColumn.setName(MATERIALIZED_VIEW_NAME_PRFIX + "hll_" + baseColumn.getName());
+                } else {
+                    throw new DdlException("The define expr of column is only support bitmap_union or hll_union");
+                }
+                newMVColumn.setIsKey(false);

Review comment:
       If the aggregate function is computed for the original column, it should be not key whether  the original column is a key column or a value 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:
users@infra.apache.org



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