[ 
https://issues.apache.org/jira/browse/HIVE-23030?focusedWorklogId=409261&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-409261
 ]

ASF GitHub Bot logged work on HIVE-23030:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Mar/20 01:13
            Start Date: 25/Mar/20 01:13
    Worklog Time Spent: 10m 
      Work Description: jcamachor commented on pull request #960: HIVE-23030 ds 
rollup union
URL: https://github.com/apache/hive/pull/960#discussion_r397519890
 
 

 ##########
 File path: ql/src/test/queries/clientpositive/sketches_rollup.q
 ##########
 @@ -0,0 +1,40 @@
+
+set hive.support.concurrency=true;
+set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
+set hive.strict.checks.cartesian.product=false;
+set hive.stats.fetch.column.stats=true;
+set hive.materializedview.rewriting=true;
+set hive.fetch.task.conversion=none;
+
+create table sketch_input (id int, category char(1))
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');
+
+insert into table sketch_input values
+  (1,'a'),(1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'), (6, 'a'), (7, 
'a'), (8, 'a'), (9, 'a'), (10, 'a'),
+  (6,'b'),(6, 'b'), (7, 'b'), (8, 'b'), (9, 'b'), (10, 'b'), (11, 'b'), (12, 
'b'), (13, 'b'), (14, 'b'), (15, 'b')
+; 
+
+-- create an mv for the intermediate results
+create  materialized view mv_1 as
+  select category, ds_hll_sketch(id),count(id) from sketch_input group by 
category;
+
+-- see if we use the mv
+explain
+select category, ds_hll_estimate(ds_hll_sketch(id)) from sketch_input group by 
category;
+
+select category, ds_hll_estimate(ds_hll_sketch(id)) from sketch_input group by 
category;
+
+-- union sketches across categories and get overall unique count estimate
+explain
+select ds_hll_estimate(ds_hll_sketch(id)) from sketch_input group by category;
+select ds_hll_estimate(ds_hll_sketch(id)) from sketch_input group by category;
+
+-- see how well mv/count works
+explain
+select count(id) from sketch_input;
 
 Review comment:
   Should we run `count distinct` here instead of explain on count?
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 409261)
    Time Spent: 0.5h  (was: 20m)

> Enable sketch union-s to be rolled up
> -------------------------------------
>
>                 Key: HIVE-23030
>                 URL: https://issues.apache.org/jira/browse/HIVE-23030
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-23030.01.patch, HIVE-23030.02.patch
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Enabling rolling up sketch aggregates could enable the matching of 
> materialized views created for higher dimensions to be applied for lower 
> dimension cases.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to