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

Gopal V commented on HIVE-11525:
--------------------------------

[~sershe]: this is now ready for review.

{code}
hive> set hive.tez.bucket.pruning=true;
 select * from t1 where x in (589077185, 589077186, 589077188);

Map 1                      2                0            0             0.06     
           500                  0            499                0
OK
589077185       113430091
Time taken: 1.205 seconds, Fetched: 1 row(s)
{code}

vs without

{code}
VERTICES         TOTAL_TASKS  FAILED_ATTEMPTS KILLED_TASKS DURATION_SECONDS    
CPU_TIME_MILLIS     GC_TIME_MILLIS  INPUT_RECORDS   OUTPUT_RECORDS 
Map 1                      2                0            0             1.38     
         7,780                 39         10,000                0
OK
589077185       113430091
Time taken: 2.747 seconds, Fetched: 1 row(s)
{code}

> Bucket pruning
> --------------
>
>                 Key: HIVE-11525
>                 URL: https://issues.apache.org/jira/browse/HIVE-11525
>             Project: Hive
>          Issue Type: Improvement
>          Components: Logical Optimizer
>    Affects Versions: 0.13.0, 0.14.0, 0.13.1, 1.0.0, 1.2.0, 1.1.0, 1.3.0, 2.0.0
>            Reporter: Maciek Kocon
>            Assignee: Gopal V
>         Attachments: HIVE-11525.1.patch, HIVE-11525.2.patch, 
> HIVE-11525.3.patch, HIVE-11525.WIP.patch
>
>
> Logically and functionally bucketing and partitioning are quite similar - 
> both provide mechanism to segregate and separate the table's data based on 
> its content. Thanks to that significant further optimisations like 
> [partition] PRUNING or [bucket] MAP JOIN are possible.
> The difference seems to be imposed by design where the PARTITIONing is 
> open/explicit while BUCKETing is discrete/implicit.
> Partitioning seems to be very common if not a standard feature in all current 
> RDBMS while BUCKETING seems to be HIVE specific only.
> In a way BUCKETING could be also called by "hashing" or simply "IMPLICIT 
> PARTITIONING".
> Regardless of the fact that these two are recognised as two separate features 
> available in Hive there should be nothing to prevent leveraging same existing 
> query/join optimisations across the two.
> BUCKET pruning
> Enable partition PRUNING equivalent optimisation for queries on BUCKETED 
> tables
> Simplest example is for queries like:
> "SELECT … FROM x WHERE colA=123123"
> to read only the relevant bucket file rather than all file-buckets that 
> belong to a table.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to