You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tajo.apache.org by "JaeHwa Jung (JIRA)" <ji...@apache.org> on 2013/12/20 17:02:09 UTC

[jira] [Comment Edited] (TAJO-428) CASE WHEN IS NULL condition is a problem using LEFT OUTER JOIN

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

JaeHwa Jung edited comment on TAJO-428 at 12/20/13 4:00 PM:
------------------------------------------------------------

I found a bug at my patch. It couldn't correct result when I used empty table at left outer join clause. At this point, it seems to be basic solution which operate scan after operate join. 
[~hyunsik], Could you fix it instead of me?


was (Author: blrunner):
I found a bug at my patch. It couldn't correct result when I used empty table at left outer join clause. At this point, it seems to be basic solution which operate scan after operate join. 

> CASE WHEN IS NULL condition is a problem using LEFT OUTER JOIN
> --------------------------------------------------------------
>
>                 Key: TAJO-428
>                 URL: https://issues.apache.org/jira/browse/TAJO-428
>             Project: Tajo
>          Issue Type: Bug
>          Components: physical operator
>    Affects Versions: 0.8-incubating
>            Reporter: JaeHwa Jung
>            Assignee: JaeHwa Jung
>             Fix For: 0.8-incubating
>
>         Attachments: TAJO-428.patch
>
>
> I found a error when I used LEFT OUTER JOIN.
> I created table for a start as follows:
> {code:title=table1 schema | borderStyle=solid}
> create external table table1 (id int, name text, score float, type text) using csv with ('csvfile.delimiter'='|', 'csvfile.null'='NULL') location 'hdfs://localhost:9010/tajo/warehouse/table1' ;
> {code}
> {code:title=table1 data | borderStyle=solid}
> 1|ooo|1.1|a
> 2|ppp|2.3|b
> 3|qqq|3.4|c
> 4|rrr|4.5|d
> 5|xxx|5.6|e
> {code}
> {code:title=table3 schema | borderStyle=solid}
> create external table table3 (id int, name text, score float, type text) using csv with ('csvfile.delimiter'='|', 'csvfile.null'='NULL') location 'hdfs://localhost:9010/tajo/warehouse/table3' ;
> {code}
> {code:title=table3 data | borderStyle=solid}
> 1|NULL||a
> 2|NULL||b
> NULL|NULL|10.0|c
> NULL|NULL|20.0|d
> {code}
> And I executed query as follows:
> {code:xml}
> select a.id, a.name, b.id as id2, b.name as name2, case when b.name is null then '9991231' else b.name end from table1 a left outer join table3 b on a.id = b.id
> {code}
> In this case, I expected the result as follows:
> {code:xml}
> id,  name,  id2,  name2,  ??
> -------------------------------
> 1,  ooo,  1,  ,  9991231
> 2,  ppp,  2,  ,  9991231
> 3,  qqq,  null,  ,  99991231
> 4,  rrr,  null,  ,  99991231
> 5,  xxx,  null,  ,  99991231
> {code} 
> But, Tajo made the result as follows:
> {code:xml}
> id,  name,  id2,  name2,  ??
> -------------------------------
> 1,  ooo,  1,  ,  9991231
> 2,  ppp,  2,  ,  9991231
> 3,  qqq,  null,  ,  
> 4,  rrr,  null,  ,  
> 5,  xxx,  null,  ,  
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)