[ 
https://issues.apache.org/jira/browse/HIVE-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13795361#comment-13795361
 ] 

Ashutosh Chauhan commented on HIVE-2419:
----------------------------------------

Instead of SemanticAnalyzer, HiveMetaStore should be the one creating WH dir 
when its starting up. We don't wh dir to be owned by first user happening to 
run query, rather WH dir should be owned by user running metastore service. 
Metastore already has a logic to create default db (if not exists) while its 
initializing, we need very similar logic for creating wh dir during same 
initialization.
 

> CREATE TABLE AS SELECT should create warehouse directory
> --------------------------------------------------------
>
>                 Key: HIVE-2419
>                 URL: https://issues.apache.org/jira/browse/HIVE-2419
>             Project: Hive
>          Issue Type: Bug
>            Reporter: David Phillips
>         Attachments: HIVE-2419.1.patch
>
>
> If you run a CTAS statement on a fresh Hive install without a warehouse 
> directory (as is the case with Amazon EMR), it runs the query but errors out 
> at the end:
> {quote}
> hive> create table foo as select * from t_message limit 1;
> Total MapReduce jobs = 1
> Launching Job 1 out of 1
> ...
> Ended Job = job_201108301753_0001
> Moving data to: 
> hdfs://ip-10-202-22-194.ec2.internal:9000/mnt/hive_07_1/warehouse/foo
> Failed with exception Unable to rename: 
> hdfs://ip-10-202-22-194.ec2.internal:9000/mnt/var/lib/hive_07_1/tmp/scratch/hive_2011-08-30_18-04-36_809_6130923980133666976/-ext-10001
>  to: hdfs://ip-10-202-22-194.ec2.internal:9000/mnt/hive_07_1/warehouse/foo
> FAILED: Execution Error, return code 1 from 
> org.apache.hadoop.hive.ql.exec.MoveTask
> {quote}
> This is different behavior from a simple CREATE TABLE, which creates the 
> warehouse directory.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to