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

ASF GitHub Bot commented on TAJO-1574:
--------------------------------------

GitHub user dongjoon-hyun opened a pull request:

    https://github.com/apache/tajo/pull/548

    TAJO-1574: Fix NPE on natural join

    Please see the description in 
https://issues.apache.org/jira/browse/TAJO-1574 .

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

    $ git pull https://github.com/dongjoon-hyun/tajo TAJO-1574

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

    https://github.com/apache/tajo/pull/548.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 #548
    
----
commit 86ac01d5d946bb540085f269eadb1860c73f033c
Author: Dongjoon Hyun <[email protected]>
Date:   2015-04-20T22:38:04Z

    TAJO-1574: Fix NPE on natural join

----


> Fix NPE on natural join
> -----------------------
>
>                 Key: TAJO-1574
>                 URL: https://issues.apache.org/jira/browse/TAJO-1574
>             Project: Tajo
>          Issue Type: Bug
>            Reporter: Dongjoon Hyun
>            Assignee: Dongjoon Hyun
>            Priority: Minor
>
> NPE occurs in a natural join.
> {code}
> default> create table t(a int);
> default> insert overwrite into t select 1;
> default> create table s(a int);
> default> insert overwrite into s select 1;
> default> select * from t natural join s;
> {code}
> The main reason is *joinQual* is null.
> {code}
>    public RESULT visitJoin(CONTEXT ctx, Stack<Expr> stack, Join expr) throws 
> PlanningException {
>      stack.push(expr);
> -    visit(ctx, stack, expr.getQual());
> +    if (expr.getQual() != null) {
> +      visit(ctx, stack, expr.getQual());
> +    }
> {code}
> {code}
> -    join.joinQual = (Expr) joinQual.clone();
> +    if (joinQual != null) {
> +      join.joinQual = (Expr) joinQual.clone();
> +    }
> {code}
> After fix, we need to get the following result.
> {code}
> default> select * from t natural join s;
> Progress: 100%, response time: 0.293 sec
> a,  a
> -------------------------------
> 1,  1
> (1 rows, 0.293 sec, 4 B selected)
> {code}



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

Reply via email to