You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:20:16 UTC

[jira] [Created] (TRAFODION-1165) LP Bug: 1443482 - Accessing hive table with ucs2 encoded field returns 0 rows.

Alice Chen created TRAFODION-1165:
-------------------------------------

             Summary: LP Bug: 1443482 - Accessing hive table with ucs2 encoded field returns 0 rows.
                 Key: TRAFODION-1165
                 URL: https://issues.apache.org/jira/browse/TRAFODION-1165
             Project: Apache Trafodion
          Issue Type: Bug
            Reporter: Howard Qin
            Assignee: Apache Trafodion
             Fix For: 2.0-incubating


When accessing hive table with ucs2 encoded field, our implementation will return 0 rows.
This is caused by using of “strchr()”, see ExHdfsScanTcb::extractAndTransformAsciiSourceToSqlRow(), 
strchr() returns at ‘\0’ before hit line delimiter ‘\n’, however the '\0' may just be a 0x00 part of ucs2 character, and the line is considered invalid.

Scripts to reproduce:

create table sck(
    userId int not null, 
    name varchar(20) character set UCS2 
);

insert into sck values (1001,  _ucs2'JBL'), (1002, _ucs2'YS '), (1003, _ucs2'8#RTG');

unload into '/ucs2test' select * from sck;

create external table hsck
(
  id int,
  name string
) row format delimited fields terminated by '|' 
location '/ucs2test';

select * from hive.hive.hsck;
Assigned to LaunchPad User khaled Bouaziz



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)