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/11/25 03:05:24 UTC

[GitHub] [incubator-doris] liuzhizu commented on a change in pull request #4317: Forbidden no grouping mv on aggregation table

liuzhizu commented on a change in pull request #4317:
URL: https://github.com/apache/incubator-doris/pull/4317#discussion_r530078281



##########
File path: fe/fe-core/src/main/java/org/apache/doris/alter/MaterializedViewHandler.java
##########
@@ -432,6 +432,9 @@ private RollupJobV2 createMaterializedViewJob(String mvName, String baseIndexNam
         List<Column> newMVColumns = Lists.newArrayList();
         int numOfKeys = 0;
         if (olapTable.getKeysType().isAggregationFamily()) {
+            if (addMVClause.getMVKeysType() != KeysType.AGG_KEYS) {

Review comment:
       the unique key table has unique feature , we need mv to aggregate  such as  bitmap_union(to_bitmap(user_id)),but  it's wrong 。
   example:
   
   CREATE TABLE t
   (
       event_day DATE,
       momo_id INT ,
       event_name VARCHAR(100),
       access_timestamp BIGINT
   )
   UNIQUE KEY(event_day,momo_id, event_name,access_timestamp)
   PARTITION BY RANGE(event_day) ()
   DISTRIBUTED BY HASH(user_id)
   PROPERTIES
   (
       "dynamic_partition.enable" = "true",
       "dynamic_partition.time_unit" = "DAY",
       "dynamic_partition.end" = "3",
       "dynamic_partition.prefix" = "p",
       "dynamic_partition.buckets" = "8",
       "storage_type"="column"
   );
   
   create materialized view mv as
   select  event_day,bitmap_union(to_bitmap(user_id))  from t group by event_day ;
   
   
   




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