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

ASF GitHub Bot commented on DRILL-4539:
---------------------------------------

GitHub user vkorukanti opened a pull request:

    https://github.com/apache/drill/pull/462

    DRILL-4539: Add support for Null Equality Joins

    @amansinha100 @jacques-n Could you please review the patches?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vkorukanti/drill null_rewrite

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/462.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #462
    
----
commit 3a1db78e24fe0b956659365a1267d9aee79a2955
Author: vkorukanti <ve...@dremio.com>
Date:   2016-04-01T23:44:24Z

    DRILL-4539 (part 1): Use custom convertlet table for IS [NOT] DISTINCT FROM 
functions
    
    Test changes:
    + Add join (hash and merge) tests that have IS NOT DISTINCT FROM in the 
join condition
    + Refactor/fix tests in TestJoinNullable class to reset options properly at 
the end of the test.

commit d9a149007e58c4219b7d0d1d9647558e27a401b8
Author: vkorukanti <ve...@dremio.com>
Date:   2016-04-04T23:25:10Z

    DRILL-4539 (part 2): Implement IS_DISTINCT_FROM and IS_NOT_DISTINCT_FROM 
functions

commit af40ee7095d02ec10bf500c24f04433e02ccb007
Author: vkorukanti <ve...@dremio.com>
Date:   2016-04-05T18:19:07Z

    DRILL-4539 (part 3): Rewrite null equal join condition as IS NOT DISTINCT 
FROM

----


> Add support for Null Equality Joins
> -----------------------------------
>
>                 Key: DRILL-4539
>                 URL: https://issues.apache.org/jira/browse/DRILL-4539
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Jacques Nadeau
>            Assignee: Venki Korukanti
>
> Tableau frequently generates queries similar to this:
> {code}
> SELECT `t0`.`city` AS `city`,
>   `t2`.`X_measure__B` AS `max_Calculation_DFIDBHHAIIECCJFDAG_ok`,
>   `t0`.`state` AS `state`,
>   `t0`.`sum_stars_ok` AS `sum_stars_ok`
> FROM (
>   SELECT `business`.`city` AS `city`,
>     `business`.`state` AS `state`,
>     SUM(`business`.`stars`) AS `sum_stars_ok`
>   FROM `mongo.academic`.`business` `business`
>   GROUP BY `business`.`city`,
>     `business`.`state`
> ) `t0`
>   INNER JOIN (
>   SELECT MAX(`t1`.`X_measure__A`) AS `X_measure__B`,
>     `t1`.`city` AS `city`,
>     `t1`.`state` AS `state`
>   FROM (
>     SELECT `business`.`city` AS `city`,
>       `business`.`state` AS `state`,
>       `business`.`business_id` AS `business_id`,
>       SUM(`business`.`stars`) AS `X_measure__A`
>     FROM `mongo.academic`.`business` `business`
>     GROUP BY `business`.`city`,
>       `business`.`state`,
>       `business`.`business_id`
>   ) `t1`
>   GROUP BY `t1`.`city`,
>     `t1`.`state`
> ) `t2` ON (((`t0`.`city` = `t2`.`city`) OR ((`t0`.`city` IS NULL) AND 
> (`t2`.`city` IS NULL))) AND ((`t0`.`state` = `t2`.`state`) OR ((`t0`.`state` 
> IS NULL) AND (`t2`.`state` IS NULL))))
> {code}
> If you look at the join condition, you'll note that the join condition is an 
> equality condition which also allows null=null. We should add a planning 
> rewrite rule and execution join option to allow null equality so that we 
> don't treat this as a cartesian join.



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

Reply via email to