hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bejoy KS" <>
Subject Re: How to load csv data into HIVE
Date Sat, 08 Sep 2012 12:33:05 GMT
Hi Chuck

I believe Praveenesh was adding his thought to the discussion on preprocessing the data using
mapreduce itself. If you go with hadoop streaming you can use the python script in the mapper
and that will do the preprocessing parallely on large volume data. Then this preprocessed
data can be loaded into hive table.

Bejoy KS

Sent from handheld, please excuse typos.

-----Original Message-----
From: "Connell, Chuck" <>
Date: Sat, 8 Sep 2012 12:18:33 
Subject: RE: How to load csv data into HIVE

I would like to hear more about this "hadoop streaming to Hive" idea. I have used streaming
jobs as mappers, with a python script as Are you saying that such a streaming mapper
can load its output into Hive? Can you send some example code? Hive wants to load "files"
not individual lines/records. How would you do this?

Thanks very much,

From: praveenesh kumar []
Sent: Saturday, September 08, 2012 7:54 AM
Subject: Re: How to load csv data into HIVE

You can use hadoop streaming that would be much faster... Just run your cleaning shell script
logic in map phase and it will be done in just few minutes. That will keep the data in HDFS.


On Fri, Sep 7, 2012 at 8:37 PM, Sandeep Reddy P <<>>
Thank you all for your help. I'll try both ways and i'll get back to you.

On Fri, Sep 7, 2012 at 11:02 AM, Mohammad Tariq <<>>
I said this assuming that a Hadoop cluster is available since Sandeep is planning to use Hive.
If that is the case then MapReduce would be faster for such large files.

    Mohammad Tariq

On Fri, Sep 7, 2012 at 8:27 PM, Connell, Chuck <<>>
I cannot promise which is faster. A lot depends on how clever your scripts are.

From: Sandeep Reddy P [<>]
Sent: Friday, September 07, 2012 10:42 AM
Subject: Re: How to load csv data into HIVE

I wrote a shell script to get csv data but when i run that script on a 12GB csv its taking
more time. If i run a python script will that be faster?
On Fri, Sep 7, 2012 at 10:39 AM, Connell, Chuck <<>>
How about a Python script that changes it into plain tab-separated text? So it would look
like this…

174969274<tab>14-mar-2006<tab>3522876<tab> <tab>14-mar-2006<tab>500000308<tab>65<tab>1<newline>

Tab-separated with newlines is easy to read and works perfectly on import.

Chuck Connell
Nuance R&D Data Team
Burlington, MA

From: Sandeep Reddy P [<>]
Subject: How to load csv data into HIVE

Here is the sample data

How to load this kind of data into HIVE?
I'm using shell script to get rid of double quotes and '|' but its taking very long time to
work on each csv which are 12GB each. What is the best way to do this?



View raw message