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 03:27:07 UTC
[jira] [Work started] (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:all-tabpanel ]
Work on TAJO-428 started by JaeHwa Jung.
> 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
> Reporter: JaeHwa Jung
> Assignee: JaeHwa Jung
>
> 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)