We can load CSV data into hive table with the help of CSV SERDE JAR FILE which is freely available. You can download it manually by clicking below text.

Download CSV SERDE Jar File

Here, we are trying to load two types of CSV data in hive table.

First type of data contains header i.e. first line in the file is header information and Second type of CSV file contains only data and no header information is given.

Following script will load CSV data containing header as first line in hive table called csvtohive

After this,
Below script will load CSV data (without containing header) in hive table called csvtohive.

Thanks for having a read.
I hope the explanation makes the scripts easier to understand.

Advertisements

One thought on “Load CSV File in Hive Table

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s