You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Suresh Subbiah (JIRA)" <ji...@apache.org> on 2015/10/08 00:48:26 UTC
[jira] [Updated] (TRAFODION-1164) LP Bug: 1443463 - '\N' and empty
string are both treated as null when selecting hive table.
[ https://issues.apache.org/jira/browse/TRAFODION-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Suresh Subbiah updated TRAFODION-1164:
--------------------------------------
Assignee: Selvaganesan Govindarajan (was: Apache Trafodion)
Component/s: sql-exe
> LP Bug: 1443463 - '\N' and empty string are both treated as null when selecting hive table.
> -------------------------------------------------------------------------------------------
>
> Key: TRAFODION-1164
> URL: https://issues.apache.org/jira/browse/TRAFODION-1164
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-exe
> Reporter: Howard Qin
> Assignee: Selvaganesan Govindarajan
> Priority: Critical
> Labels: hive, null
> Fix For: 2.0-incubating
>
>
> When loading/selecting from hive table, we treat both empty string and '\N' as null, this doesn't conform with hive behavior, in which, user can configure what null character is.
> The issue can be explain in following steps:
> 1)
> >select * from t1;
> A B
> ----------- ------------------------------------------------------------------------------------------------------------------------
> 4
> 1 ?
> 2 fsdf
> 3 hhah
> 2)
> unload with null_string '\N' into '/nulltest' select * from t1;
> -bash-4.1$ swhdfs dfs -cat /nulltest/file0-20150410015053-828
> 4|
> 1|\N
> 2|fsdf
> 3|hhah
> 3)
> hive> create external table nulltest ( A int, B string )
> > row format delimited fields terminated by '|'
> > location '/nulltest'
> > tblproperties ('serialization.null.format' = '\\N');
> hive> select * from nulltest;
> OK
> nulltest.a nulltest.b
> 4 <-- empty string
> 1 NULL
> 2 fsdf
> 3 hhah
> 4)
> >>select * from hive.hive.nulltest;
> A B
> ----------- ------------------------------------------------------------------------------------------------------------------------
> 4 ? <-- empty string is considered null.
> 1 ?
> 2 fsdf
> 3 hhah
> >select * from t1;
> A B
> ----------- ------------------------------------------------------------------------------------------------------------------------
> 4 <-- should consist with t1 and hive.
> 1 ?
> 2 fsdf
> 3 hhah
> Assigned to LaunchPad User khaled Bouaziz
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)