[
https://issues.apache.org/jira/browse/HIVE-11110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14605543#comment-14605543
]
Jesus Camacho Rodriguez commented on HIVE-11110:
------------------------------------------------
I have analyzed the results; fails fall in different categories that need to be
further analyzed:
- Some of them are benign: additional filters are added or the join inputs were
swapped.
- In some cases, 2-input joins are not merged into 3-input joins (join_3.q,
annotate_stats_join.q, auto_join3.q, explain_logical.q), which might result in
additional execution stages.
- In another case, a new 3-input join that was not identified before is created
(correlation_optimizer6.q).
- There seems to be a few cases with lost of bucketing using insert overwrite
(infer_bucket_sort.q, join_33.q).
--
Apart from these, the new rule triggers indefinitely for subquery_views.q. This
is solved by [~jpullokkaran] patch by putting the HiveJoinAddNotNullRule rule
on its own group of rules, but the issue should be studied further too.
> Enable HiveJoinAddNotNullRule in CBO
> ------------------------------------
>
> Key: HIVE-11110
> URL: https://issues.apache.org/jira/browse/HIVE-11110
> Project: Hive
> Issue Type: Bug
> Components: CBO
> Reporter: Jesus Camacho Rodriguez
> Assignee: Jesus Camacho Rodriguez
> Attachments: HIVE-11110.1.patch, HIVE-11110.patch
>
>
> Query
> {code}
> select count(*)
> from store_sales
> ,store_returns
> ,date_dim d1
> ,date_dim d2
> where d1.d_quarter_name = '2000Q1'
> and d1.d_date_sk = ss_sold_date_sk
> and ss_customer_sk = sr_customer_sk
> and ss_item_sk = sr_item_sk
> and ss_ticket_number = sr_ticket_number
> and sr_returned_date_sk = d2.d_date_sk
> and d2.d_quarter_name in ('2000Q1','2000Q2','2000Q3’);
> {code}
> The store_sales table is partitioned on ss_sold_date_sk, which is also used
> in a join clause. The join clause should add a filter “filterExpr:
> ss_sold_date_sk is not null”, which should get pushed the MetaStore when
> fetching the stats. Currently this is not done in CBO planning, which results
> in the stats from __HIVE_DEFAULT_PARTITION__ to be fetched and considered in
> the optimization phase. In particular, this increases the NDV for the join
> columns and may result in wrong planning.
> Including HiveJoinAddNotNullRule in the optimization phase solves this issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)