I am trying to insert a CSV File into Hive with one field being array of string .
Here is the CSV File :
48,Snacks that Power Up Weight Loss,Aidan B. Prince,[Health&Fitness,Travel]
99,Snacks that Power Up Weight Loss,Aidan B. Prince,[Photo,Travel]
I tried creating table something like this :
CREATE TABLE IF NOT EXISTS Article
(
ARTICLE_ID INT,
ARTICLE_NSAME STRING,
ARTICLE_AUTHOR STRING,
ARTICLE_GENRE ARRAY<STRING>
);
LOAD DATA INPATH '/tmp/pinterest/article.csv' OVERWRITE INTO TABLE Article;
select * from Article;
Here is output what I get :
article.article_id article.article_name article.article_author article.article_genre
48 Snacks that Power Up Weight Loss Aidan B. Prince ["[Health&Fitness"]
99 Snacks that Power Up Weight Loss Aidan B. Prince ["[Photo"]
Its taking only one value in last field article_genre .
Can someone point out what wrong here ?
[Health&Fitnessis stored asARTICLE_GENRE, and the "new column"Travel]is ignored. Your fourth column is not in the format that Hive expects an array to be in. - Ben Watson