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

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_r397522993
 
 

 ##########
 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
 
 Review comment:
   It seems these two queries can be deleted since this is already covered by 
the queries above (except that category is not shown in the result here)?
 
----------------------------------------------------------------
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: 409265)
    Time Spent: 50m  (was: 40m)

> 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: 50m
>  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