[ https://issues.apache.org/jira/browse/HIVE-23462?focusedWorklogId=442560&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-442560 ]
ASF GitHub Bot logged work on HIVE-23462: ----------------------------------------- Author: ASF GitHub Bot Created on: 08/Jun/20 03:43 Start Date: 08/Jun/20 03:43 Worklog Time Spent: 10m Work Description: jcamachor commented on a change in pull request #1031: URL: https://github.com/apache/hive/pull/1031#discussion_r436443600 ########## File path: ql/src/test/queries/clientpositive/sketches_materialized_view_cume_dist.q ########## @@ -0,0 +1,54 @@ +--! qt:transactional +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_kll_sketch(cast(-id as float)) from sketch_input group by category; + +-- bi mode on +set hive.optimize.bi.enabled=true; + +explain +select 'rewrite; mv matching', id, cume_dist() over (order by id) from sketch_input order by id; +select 'rewrite; mv matching', id, cume_dist() over (order by id) from sketch_input order by id; Review comment: Yes, that's certainly useful. Something that may help for explain plans is to use `explain cbo` as it is definitely less verbose. ---------------------------------------------------------------- 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: 442560) Time Spent: 2h 40m (was: 2.5h) > Add option to rewrite CUME_DIST to sketch functions > --------------------------------------------------- > > Key: HIVE-23462 > URL: https://issues.apache.org/jira/browse/HIVE-23462 > Project: Hive > Issue Type: Sub-task > Reporter: Zoltan Haindrich > Assignee: Zoltan Haindrich > Priority: Major > Labels: pull-request-available > Attachments: HIVE-23462.01.patch, HIVE-23462.02.patch, > HIVE-23462.03.patch, HIVE-23462.04.patch > > Time Spent: 2h 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)