[
https://issues.apache.org/jira/browse/HIVE-20342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16590372#comment-16590372
]
Pablo Idiaquez commented on HIVE-20342:
---------------------------------------
LOCATION in this case requires to include FULL HDFS URI Path to work without
giving error
{code:java}
CREATE TABLE test4 ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe' STORED AS RCFILE
LOCATION 'hdfs://NAMENODE:8020/tmp/test4'
AS SELECT * FROM test;
{code}
However If LOCATION is passed with the short format '/folder/subfolder' ( no
hdfs://NN prefix) . it will still fail
> Create table from CTAS with location fails for managed tables
> -------------------------------------------------------------
>
> Key: HIVE-20342
> URL: https://issues.apache.org/jira/browse/HIVE-20342
> Project: Hive
> Issue Type: Bug
> Components: Beeline, HiveServer2
> Affects Versions: 3.0.0
> Reporter: Pablo Idiaquez
> Priority: Blocker
>
> When attempting to create table from SELECT with LOCATION (managed tables)
>
> To reproduce CREATE source table CLASS with some data
> then use the code below to CREATE table TABLE42 from select on CLASS and
> LOCATION /tmp/test1
>
> {code:java}
> CREATE TABLE TABLE42 ROW FORMAT SERDE
> 'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe' STORED AS RCFILE
> LOCATION '/tmp/test1'
> AS SELECT * FROM
> CLASS;
> {code}
>
> it fails with ERROR:
> {code:java}
> ERROR : Job Commit failed with exception
> 'org.apache.hadoop.hive.ql.metadata.HiveException(The following files were
> committed but not found: [/tmp/test1/delta_0000001_0000001_0000/000000_0])'
> org.apache.hadoop.hive.ql.metadata.HiveException: The following files were
> committed but not found: [/tmp/test1/delta_0000001_0000001_0000/000000_0]
> at
> org.apache.hadoop.hive.ql.exec.Utilities.handleMmTableFinalPath(Utilities.java:4329)
>
> at
> org.apache.hadoop.hive.ql.exec.FileSinkOperator.jobCloseOp(FileSinkOperator.java:1393)
>
> {code}
>
> If the same is attempted for an EXTERNAL table will work OK
> {code:java}
> CREATE EXTERNAL TABLE test3 ROW FORMAT SERDE
> 'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe' STORED AS RCFILE
> LOCATION '/tmp/test2' AS SELECT * FROM test;
> {code}
> if we CREATE table on statement 1, and INSERT from SELECT on statement 2 ,
> will work OK.
> (Step1 CREATE TABLE)
> {code:java}
> CREATE TABLE `TABLE42`(
> `COL1` double,
> `COL2` varchar(8),
> `COL3` varchar(1),
> `COL4` double,
> `COL5` double)
> ROW FORMAT SERDE
> 'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
> STORED AS INPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
> OUTPUTFORMAT
> 'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
> LOCATION '/tmp/test1';
> {code}
> (Step2 INSERT from SELECT)
> {code:java}
> INSERT into TABLE42 select * FROM CLASS;
> {code}
> will work as expected.
>
> Thanks
> Pablo
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)