hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mayuran Yogarajah <>
Subject Re: Loading data directories into Hive DB
Date Fri, 15 Jan 2010 00:15:14 GMT
> I'm clearly missing something. How can I create a script to allow to 
> import partitioned datasets as above into a Hive table?
So you want to load part-00000 and part-00001 as two separate partitions?
If so, you'll need to have those files in separate subdirs.

I put them into subdirs like this, so you can partition it by mapper.

Then in Hive:
create external table test (
words string )
partitioned by (mapper string)
stored as textfile location '/user/hadoop;

Then add the partitions:
alter table test add partition (mapper='mapper1') location 
alter table test add partition (mapper='mapper2') location 

Sanity check:
hive> show partitions test;

hive> select *from test;
bar     mapper1
foo     mapper2

Hope this helps..


View raw message