hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Sammer <e...@lifeless.net>
Subject Re: Loading data directories into Hive DB
Date Fri, 15 Jan 2010 00:19:22 GMT
On 1/14/10 6:54 PM, Rob Stewart wrote:
> However, with Hive if I try:
> CREATE EXTERNAL TABLE Text(words STRING)
> LOCATION 'InputData/JoinApp/HiveTable';
> hadoop dfs -cp InputData/JoinApp InputData/JoinApp/HiveTable
> 
> I get the following error:
> cp: Target InputData/JoinApp is a directory
> 
> I'm clearly missing something. How can I create a script to allow to
> import partitioned datasets as above into a Hive table?

Rob:

The only error here is in the dfs -cp syntax and is unrelated to Hive,
itself. Hive will handle multiple files in the
InputData/JoinApp/HiveTable/ directory if you copy them in there, as
you'd expect.

The proper syntax to copy the files into that Hive directories is:

hadoop dfs -cp 'InputData/JoinApp/*' InputData/JoinApp/HiveTable/

Note the wildcard indicating "all files in JoinApp."

-- 
Eric Sammer
eric@lifeless.net
http://esammer.blogspot.com

Mime
View raw message