[ https://issues.apache.org/jira/browse/TRAFODION-2013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15299274#comment-15299274 ]
Anoop Sharma commented on TRAFODION-2013: ----------------------------------------- An error is being returned if a single value of string of length zero is inserted. This is not related to null handling but is in surrounding code. >>insert into hive.hive.t values (''); *** ERROR[3003] Length or precision must be greater than zero. *** ERROR[15001] A syntax error occurred at or before: cast(@A1 as VARCHAR(0) CHARACTER SET ISO88591 NOT NULL); ^ (21 characters from start of SQL statement) *** ERROR[7000] An internal error occurred in the code generator in file ../generator/GenFastTransport.cpp at line 322: Error building expression tree for LM child Input value. *** ERROR[2235] Compiler Internal Error: An unknown error, originated from file ../generator/Generator.cpp at line 2819. *** ERROR[8822] The statement was not prepared. >> > Hive null values for string datatype are not being handled correctly > -------------------------------------------------------------------- > > Key: TRAFODION-2013 > URL: https://issues.apache.org/jira/browse/TRAFODION-2013 > Project: Apache Trafodion > Issue Type: Bug > Reporter: Anoop Sharma > Assignee: Anoop Sharma > > During reads, by default, a string of length zero in a hive file should be > treated as a null value for non-string datatypes, and should be treated as > string of length zero for string datatypes. A string of '\N' should be > treated as null value for string datatypes. > Similarly, during writes, a non-string datatype null should be written out > as an empty string and a string datatype null value should be written out as > '\N'. > In Traf, during reads, a string of length zero is being returned as a null > value for string datatypes. It is however, being correctly returned as a null > value for non-string datatypes. > And during writes, a null value is being written out as a string of length > zero for string datatypes. > examples of incorrect behavior: > from hive: > create table t (a string); > from sqlci: > insert into t values (null), ('a'), (''); > from hive: > hive> select * from t; > OK > t.a > a > Time taken: 0.358 seconds, Fetched: 3 row(s) > Returns 3 rows with null row being written out as string of length zero. > From sqlci: > >>select * from hive.hive.t; > A > ---------- > ? > a > ? > --- 3 row(s) selected. > 2 rows with string of length zero are being returned as null rows. -- This message was sent by Atlassian JIRA (v6.3.4#6332)