Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a HIVE table to read semicolon separated values

Tags:

hadoop

hive

I want to create a HIVE table that will read in semicolon separated values, but my code keeps giving me errors. Does anyone have any suggestions?

CREATE TABLE test_details(Time STRING, Vital STRING, sID STRING) 
PARTITIONED BY(Country STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ';'
STORED AS TEXTFILE;
like image 590
user3121369 Avatar asked Dec 05 '22 04:12

user3121369


1 Answers

For me nothing worked except this:

FIELDS TERMINATED BY '\u0059'

Edit: After updating Hive:

FIELDS TERMINATED BY '\u003B'

so in full:

CREATE TABLE test_details(Time STRING, Vital STRING, sID STRING) 
PARTITIONED BY(Country STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0059'
STORED AS TEXTFILE;
like image 132
Laurens Koppenol Avatar answered Mar 06 '23 04:03

Laurens Koppenol