hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reuben Kuhnert (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-13231) Show helpful error message on failure to create nested table in nested directory
Date Tue, 08 Mar 2016 17:51:41 GMT

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

Reuben Kuhnert commented on HIVE-13231:
---------------------------------------

So it looks like it ~does work if you have {{hive.insert.into.multilevel.dirs}} turned on:

{code}
class MoveTask {
  private void moveFile(Path sourcePath, Path targetPath, boolean isDfsDir) {
    ...
    if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) {
      deletePath = createTargetPath(targetPath, fs);
    }
    ...
  }
}
{code}

In action:

{code}
(Using gerrit/cdh5-1.1.0_dev)

0: jdbc:hive2://localhost:10000> set hive.insert.into.multilevel.dirs;
+----------------------------------------+--+
|                  set                   |
+----------------------------------------+--+
| hive.insert.into.multilevel.dirs=true  |
+----------------------------------------+--+

0: jdbc:hive2://localhost:10000> create table shouldwork location '/user/hive/warehouse/x/y/z/shouldwork'
as select * from another;
arehouse/x/y/z/shouldwork' as select * from another;
INFO  : Compiling command(queryId=sircodesalot_20160105131616_2bbad703-76fe-4621-809e-11a16ee72182):
create table shouldwork location '/user/hive/warehouse/x/y/z/shouldwork' as select * from
another
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:another.id, type:int,
comment:null), FieldSchema(name:another.name, type:string, comment:null)], properties:null)
INFO  : Completed compiling command(queryId=sircodesalot_20160105131616_2bbad703-76fe-4621-809e-11a16ee72182);
Time taken: 1.023 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=sircodesalot_20160105131616_2bbad703-76fe-4621-809e-11a16ee72182):
create table shouldwork location '/user/hive/warehouse/x/y/z/shouldwork' as select * from
another
INFO  : Query ID = sircodesalot_20160105131616_2bbad703-76fe-4621-809e-11a16ee72182
INFO  : Total jobs = 3
INFO  : Launching Job 1 out of 3
INFO  : Starting task [Stage-1:MAPRED] in serial mode
INFO  : Number of reduce tasks is set to 0 since there's no reduce operator
INFO  : Job running in-process (local Hadoop)
INFO  : 2016-01-05 13:16:43,251 Stage-1 map = 100%,  reduce = 0%
INFO  : Ended Job = job_local1497036142_0001
INFO  : Starting task [Stage-7:CONDITIONAL] in serial mode
INFO  : Stage-4 is selected by condition resolver.
INFO  : Stage-3 is filtered out by condition resolver.
INFO  : Stage-5 is filtered out by condition resolver.
INFO  : Starting task [Stage-4:MOVE] in serial mode
INFO  : Moving data to: file:/user/hive/warehouse/.hive-staging_hive_2016-01-05_13-16-39_477_4080666378917536585-1/-ext-10001
from file:/user/hive/warehouse/.hive-staging_hive_2016-01-05_13-16-39_477_4080666378917536585-1/-ext-10003
INFO  : Starting task [Stage-0:MOVE] in serial mode
INFO  : Moving data to: /user/hive/warehouse/x/y/z/shouldwork from file:/user/hive/warehouse/.hive-staging_hive_2016-01-05_13-16-39_477_4080666378917536585-1/-ext-10001
INFO  : Starting task [Stage-8:DDL] in serial mode
INFO  : Starting task [Stage-2:STATS] in serial mode
INFO  : Table default.shouldwork stats: [numFiles=1, numRows=2, totalSize=25, rawDataSize=23]
INFO  : MapReduce Jobs Launched: 
INFO  : Stage-Stage-1:  HDFS Read: 0 HDFS Write: 0 SUCCESS
INFO  : Total MapReduce CPU Time Spent: 0 msec
INFO  : Completed executing command(queryId=sircodesalot_20160105131616_2bbad703-76fe-4621-809e-11a16ee72182);
Time taken: 20.601 seconds
INFO  : OK
No rows affected (21.644 seconds)


0: jdbc:hive2://localhost:10000> select * from shouldwork;
select * from shouldwork;
INFO  : Compiling command(queryId=sircodesalot_20160105131717_4cd8dc3b-a732-4133-86c2-7261d567b6bf):
select * from shouldwork
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:shouldwork.id, type:int,
comment:null), FieldSchema(name:shouldwork.name, type:string, comment:null)], properties:null)
INFO  : Completed compiling command(queryId=sircodesalot_20160105131717_4cd8dc3b-a732-4133-86c2-7261d567b6bf);
Time taken: 0.215 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=sircodesalot_20160105131717_4cd8dc3b-a732-4133-86c2-7261d567b6bf):
select * from shouldwork
INFO  : Completed executing command(queryId=sircodesalot_20160105131717_4cd8dc3b-a732-4133-86c2-7261d567b6bf);
Time taken: 0.0 seconds
INFO  : OK
+----------------+------------------+--+
| shouldwork.id  | shouldwork.name  |
+----------------+------------------+--+
| 1              | something        |
| 2              | otherthing       |
+----------------+------------------+--+
{code}

Although it makes sense that this property is not set by default, it does make sense to notify
the user that a property exists to allow automatic nested directory creation.


> Show helpful error message on failure to create nested table in nested directory
> --------------------------------------------------------------------------------
>
>                 Key: HIVE-13231
>                 URL: https://issues.apache.org/jira/browse/HIVE-13231
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>            Reporter: Reuben Kuhnert
>            Assignee: Reuben Kuhnert
>            Priority: Minor
>         Attachments: CDH-37508.01.patch
>
>
> cannot store data in a directory whose parent doesn't exist, even though the target dir
does have an existing ancestor on HDFS. This occurs when trying to perform {{create table
<location>}}.
> {code}
> 0: jdbc:hive2://10.17.81.192:10000/default> create table test3 location '/user/hive/data/yshi/nonexisting/test3'
as select * from sample_07;
> Error: Error while processing statement: FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.MoveTask (state=08S01,code=1)
> Error message:
> 2015-10-29 19:04:46,323 ERROR org.apache.hadoop.hive.ql.exec.Task: Failed with exception
Unable to rename: hdfs://host-10-17-81-192.coe.cloudera.com:8020/user/hive/warehouse/.hive-staging_hive_2015-10-29_19-04-08_375_5385987873542863570-3/-ext-10001
to: /user/hive/data/yshi/nonexisting/test3
> org.apache.hadoop.hive.ql.metadata.HiveException: Unable to rename: hdfs://host-10-17-81-192.coe.cloudera.com:8020/user/hive/warehouse/.hive-staging_hive_2015-10-29_19-04-08_375_5385987873542863570-3/-ext-10001
to: /user/hive/data/yshi/nonexisting/test3
>         at org.apache.hadoop.hive.ql.exec.MoveTask.moveFile(MoveTask.java:101)
>         at org.apache.hadoop.hive.ql.exec.MoveTask.execute(MoveTask.java:209)
>         at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:153)
>         at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:85)
>         at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1554)
>         at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1321)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1139)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:962)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:957)
>         at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:144)
>         at org.apache.hive.service.cli.operation.SQLOperation.access$000(SQLOperation.java:68)
>         at org.apache.hive.service.cli.operation.SQLOperation$1$1.run(SQLOperation.java:199)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:415)
>         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1642)
>         at org.apache.hadoop.hive.shims.HadoopShimsSecure.doAs(HadoopShimsSecure.java:502)
>         at org.apache.hive.service.cli.operation.SQLOperation$1.run(SQLOperation.java:212)
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:745)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message