I'm trying to load a .csv file on disk into Hive.
Per this answer on StackOverflow, I created the table using the following query:
CREATE TABLE mytable
(
id_number STRING,
country STRING
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
STORED AS TEXTFILE;
I then dumped the data from the file into Hive using the following query:
LOAD DATA LOCAL INPATH /mytable.csv OVERWRITE INTO TABLE mytable;
Unfortunately, the result table in hive consisted of a single row, where each element (shown below) is a smashed-together version of a row from the .csv file:
"aDXLS23M\tRussia"
I've been stuck on this for hours and can't figure out how to get hive to recognize the column separators in the .csv file. Any suggestions?
Thanks in advance.