10-12-2017 11:46 AM
I am trying to load a csv file to a table in hive
I gave as below to create the table.
CREATE TABLE cp
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
STORED AS TEXTFILE
the output is : each record as a Null record.. so I get exactly double the count.
What am I missing here ? tried with \t, even line terminator \n etc... no luck.
10-21-2017 02:35 PM
CDH 5.10.1 and Hive 0.14.
I guess the suspect is encoding.
The csv file I am using is a UTF-16 Little Endian and when I convert into UTF-8 it works fine. But that is not the solution I want as these files cannot be changed it comes from client. the only option is I need to do something during "Create External Table " I tried all sort of things.
serialization.encoding = 'WINDOWS-1252' , UTF-16, UTF-16LE etc... nothing works..
Has anyone come across this kinda situation, pl let me know.