tajo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hyunsik Choi (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (TAJO-428) CASE WHEN IS NULL condition is a problem using LEFT OUTER JOIN
Date Mon, 20 Jan 2014 01:51:21 GMT

     [ https://issues.apache.org/jira/browse/TAJO-428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hyunsik Choi resolved TAJO-428.
-------------------------------

    Resolution: Fixed

Fixed by TAJO-501.

> 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: Hyunsik Choi
>             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.5#6160)

Mime
View raw message