hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gopal V (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HIVE-20333) CBO: Join removal based on PK-FK declared constraints
Date Wed, 10 Oct 2018 03:51:00 GMT

     [ https://issues.apache.org/jira/browse/HIVE-20333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gopal V resolved HIVE-20333.
----------------------------
    Resolution: Duplicate

> CBO: Join removal based on PK-FK declared constraints
> -----------------------------------------------------
>
>                 Key: HIVE-20333
>                 URL: https://issues.apache.org/jira/browse/HIVE-20333
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Gopal V
>            Priority: Major
>
> A query of the following shape can have its customer join removed entirely on the basis
of the key containment between customer & store_sales.
> {code}
> select c_customer_sk,sum(ss_quantity*ss_sales_price) ssales from store_sales ,customer
where ss_customer_sk = c_customer_sk group by c_customer_sk;
> {code}
> This query after join removal can be encoded in as 
> {code}
> select ss_customer_sk as c_customer_sk,sum(ss_quantity*ss_sales_price) ssales from store_sales
where ss_customer_sk is not null group by ss_customer_sk;
> {code}
> The rewrite is not applied today and the current PK-FK relationship does not allow for
a nullable relationship (i.e a declared Foreign Key can't be NULL).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message