Reputation: 138
I have a CSV file which has rows in the following format,
1, 11812, 15273, "2016-05-22T111647.800 US/Eastern", 82971850, 0
1, 11812, 7445, "2016-05-22T113640.200 US/Eastern", 82971928, 0
1, 11654, 322, "2016-05-22T113845.773 US/Eastern", 82971934, 0
1, 11722, 0, "2016-05-22T113929.541 US/Eastern", 82971940, 0
The I create a Hive table with the following command,
create table event_history(status tinyint, condition smallint,
machine_id int, time timestamp, ident int, state tinyint)
Then I am trying to load the CSV file into the table with the following command,
load data local inpath "/home/ubuntu/events.csv" into table event_history;
But all I get is NULLs when I try to do a select query in the created table. What am I missing here?
The Hive version is Hive 1.2.1
Upvotes: 5
Views: 10910
Reputation: 138
My error was in the table creation. Fixed it with the following changes
create table event_history(status tinyint, condition smallint, machine_id int,
time timestamp, drqs int, state tinyint) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',';
Upvotes: 8