You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/14 12:23:41 UTC

[jira] [Commented] (DRILL-5263) Prevent left NLJoin with non scalar subqueries

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

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

GitHub user Serhii-Harnyk opened a pull request:

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

    DRILL-5263: Prevent left NLJoin with non scalar subqueries

    

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

    $ git pull https://github.com/Serhii-Harnyk/drill DRILL-5263

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

    https://github.com/apache/drill/pull/748.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 #748
    
----
commit fff774ed62bf85f36a0167b1e8c49c1339312131
Author: Serhii-Harnyk <se...@gmail.com>
Date:   2017-02-13T14:30:27Z

    DRILL-5263: Prevent left NLJoin with non scalar subqueries

----


> Prevent left NLJoin with non scalar subqueries
> ----------------------------------------------
>
>                 Key: DRILL-5263
>                 URL: https://issues.apache.org/jira/browse/DRILL-5263
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Serhii Harnyk
>            Assignee: Serhii Harnyk
>         Attachments: tmp.tar.gz
>
>
> Nested loop join operator in Drill supports only inner join and returns incorrect result for queries with left join and non scalar sub-queries. Drill should throw error in this case.
> Example:
> {code:sql}
> alter session set planner.enable_nljoin_for_scalar_only=false;
> select t2.dt, t1.fyq, t2.who, t2.event
> from t2
> left join t1 on t2.dt between t1.dts and t1.dte
> order by t2.dt;
> {code}
> Result:
> {noformat}
> +-------------+----------+----------+--------------------+
> |     dt      |   fyq    |   who    |       event        |
> +-------------+----------+----------+--------------------+
> | 2016-12-26  | 2016-Q2  | aperson  | had chrsitmas      |
> | 2017-01-06  | 2016-Q3  | aperson  | did somthing       |
> | 2017-01-12  | 2016-Q3  | aperson  | did somthing else  |
> +-------------+----------+----------+--------------------+
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)