Turns out this was a simple issue of permissions.

To fix it, I first created a group called "hive" on my system.

Then I added myself to that group:
kostmo@leetbook:~$ sudo usermod -aG hive kostmo

Then I changed the group ownership of the warehouse directory:
kostmo@leetbook:~$ sudo /home/kostmo/hadoop-0.20.2/bin/hadoop fs -chgrp hive
/user/hive/warehouse

and verified the new ownership:
kostmo@leetbook:~$ /home/kostmo/hadoop-0.20.2/bin/hadoop fs -ls /user/hive
Found 1 items
drwxrwxr-x   - root hive       4096 2011-04-20 14:03 /user/hive/warehouse

Finally, I had to log out and log back in to my system for my new group
membership to take effect.  And now I get:
hive> CREATE TABLE pokes (foo INT, bar STRING);
OK
Time taken: 3.568 seconds

Karl


On Wed, Apr 20, 2011 at 1:38 PM, Jonathan Natkins <na...@cloudera.com>wrote:

> Couple questions:
>
> 1) Do you see any blips on the namenode logs?
> 2) What is your HADOOP_HOME set to?
>
> I've definitely run into this error before, but I can never remember
> exactly what the issue is.  I think it's related to hive either using the
> wrong hadoop binary, or hive isn't pointed at the correct hadoop instance,
> or something along those lines.
>
>
> On Wed, Apr 20, 2011 at 1:24 PM, Karl Ostmo <kos...@gmail.com> wrote:
>
>> Hello,
>> I am encountering the exact issue that a user posted about last month
>> (with no response):
>>
>> http://mail-archives.apache.org/mod_mbox/hive-dev/201103.mbox/%3caanlktimf6cr4v3-x+memr9po7dkmlwv23jf38x2+k...@mail.gmail.com%3E#archives
>>
>> I have been working my way through the Hive GettingStarted guide (
>> http://wiki.apache.org/hadoop/Hive/GettingStarted#Running_Hive), but when
>> I try to create a table (
>> http://wiki.apache.org/hadoop/Hive/GettingStarted#DDL_Operations), I get
>> this error:
>>
>> hive> CREATE TABLE pokes (foo INT, bar STRING);
>> FAILED: Error in metadata: MetaException(message:Got exception:
>> java.io.FileNotFoundException File file:/user/hive/warehouse/pokes does not
>> exist.)
>> FAILED: Execution Error, return code 1 from
>> org.apache.hadoop.hive.ql.exec.DDLTask
>>
>> I believe my HDFS is set up properly:
>>
>> kostmo@leetbook:~$ /home/kostmo/hadoop-0.20.2/bin/hadoop fs -ls /user/
>> Found 1 items
>> drwxr-xr-x   - root root       4096 2011-03-28 17:22 /user/hive
>> kostmo@leetbook:~$ /home/kostmo/hadoop-0.20.2/bin/hadoop fs -ls
>> /user/hive
>> Found 1 items
>> drwxrwxr-x   - root root       4096 2011-03-28 17:22 /user/hive/warehouse
>>
>> Karl
>>
>
>

Reply via email to