Error loading CSV data into Hive table

I have a CSV file that has lines 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

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 try to load the CSV file into a table with the following command:

load data local inpath "/home/ubuntu/events.csv" into table event_history;

But all I get is NULL when I try to execute a select query on a created table. What am I missing here?

Hive Hive Version 1.2.1

+4
source share
1 answer

My mistake was creating a table. 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 ',';
+8
source

All Articles