You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Gopal V (JIRA)" <ji...@apache.org> on 2013/08/14 23:59:50 UTC

[jira] [Commented] (HIVE-5093) Use a combiner for LIMIT with GROUP BY and ORDER BY operators

    [ https://issues.apache.org/jira/browse/HIVE-5093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13740258#comment-13740258 ] 

Gopal V commented on HIVE-5093:
-------------------------------

Quick test-results 

{code}
hive> set min.num.spills.for.combine=0;            
hive> set hive.exec.combiner=false;

hive> select cd_credit_rating, cd_education_status from customer_demographics order by cd_credit_rating limit 10;

Job 0: Map: 1  Reduce: 1   Cumulative CPU: 14.92 sec   HDFS Read: 18709 HDFS Write: 130 SUCCESS

Reduce input groups 	4
Reduce input records 	480200 
{code}

With the optimizer on

{code}
hive> set hive.exec.combiner=true;

hive> select cd_credit_rating, cd_education_status from customer_demographics order by cd_credit_rating limit 10;

Job 0: Map: 1  Reduce: 1   Cumulative CPU: 9.39 sec   HDFS Read: 18709 HDFS Write: 130 SUCCESS

Reduce input groups 	1
Reduce input records 	10 

{code}

That is a massive reduction in reduce records for minimal complexity (the spills per-combiner is set to zero, to always run it).

On query27, we went from 816036 bytes shuffled to 9006 bytes shuffled over-all.


                
> Use a combiner for LIMIT with GROUP BY and ORDER BY operators
> -------------------------------------------------------------
>
>                 Key: HIVE-5093
>                 URL: https://issues.apache.org/jira/browse/HIVE-5093
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 0.12.0
>            Reporter: Gopal V
>            Assignee: Gopal V
>
> Operator trees of the following structure can have a memory friendly combiner put in place after the sort-phase 
> "GBY-LIM" and "OBY-LIM"
> This will cut down on I/O when spilling to disk and particularly during the merge phase of the reducer.
> There are two possible combiners - LimitNKeysCombiner and LimitNValuesCombiner.
> The first one would be ideal for the GROUP-BY case, while the latter would more useful for the ORDER-BY case.
> The combiners are still relevant even if there are 1:1 forward operators on the reducer side and for small data items, the MR base layer does not run the combiners at all.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira