<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question what is the default behavior of insert overwrite on external hdfs table? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/what-is-the-default-behavior-of-insert-overwrite-on-external/m-p/236536#M198349</link>
    <description>&lt;P&gt;Our Hortonworks version is 2.6.3.0-235, our Hive version is 1.2.1000&lt;/P&gt;&lt;P&gt;We have the following issue at the moment:&lt;/P&gt;&lt;P&gt;Hive insert overwrite will fail on external table if the external table's folder does not exist.&lt;/P&gt;&lt;P&gt;Here is the details:&lt;/P&gt;&lt;P&gt;We have an external table &lt;STRONG&gt;"config_another_test_output". &lt;/STRONG&gt;Here is the table information:&lt;/P&gt;&lt;P&gt;+---------------------------------------------------------------------------------------------------------------------+--+&lt;BR /&gt;|  createtab_stmt  |&lt;BR /&gt;+---------------------------------------------------------------------------------------------------------------------+--+&lt;BR /&gt;| CREATE EXTERNAL TABLE `config_another_test_output`(  |&lt;BR /&gt;|  `stars` string,  |&lt;BR /&gt;|  `desc` string,  |&lt;BR /&gt;|  `pros` string,  |&lt;BR /&gt;|  `cons` string,  |&lt;BR /&gt;|  `advice` string,  |&lt;BR /&gt;|  `summary` string)  |&lt;BR /&gt;| ROW FORMAT SERDE  |&lt;BR /&gt;|  'org.apache.hadoop.hive.ql.io.orc.OrcSerde'  |&lt;BR /&gt;| STORED AS INPUTFORMAT  |&lt;BR /&gt;|  'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'  |&lt;BR /&gt;| OUTPUTFORMAT  |&lt;BR /&gt;|  'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'  |&lt;BR /&gt;| LOCATION  |&lt;BR /&gt;|&lt;STRONG&gt;  'hdfs://titan/dev/10112/app/TC30/dataiku/CONFIG_ANOTHER_TEST/output'  |&lt;/STRONG&gt;&lt;BR /&gt;| TBLPROPERTIES (  |&lt;BR /&gt;|  'COLUMN_STATS_ACCURATE'='{\"BASIC_STATS\":\"true\"}',  |&lt;BR /&gt;|  'DSS_DEFAUT_HIVE_TABLE_TAG'='eyJtZ3QiOnRydWUsImZtdCI6IjhpeTNOYSIsInBhcnQiOiIxQjJNMlkiLCJsb2MiOiJNNzJVeHAifQ==',  |&lt;BR /&gt;|  'numFiles'='1',  |&lt;BR /&gt;|  'numRows'='621',  |&lt;BR /&gt;|  'orc.compress'='SNAPPY',  |&lt;BR /&gt;|  'rawDataSize'='1548153',  |&lt;BR /&gt;|  'totalSize'='233502',  |&lt;BR /&gt;|  'transient_lastDdlTime'='1542815783')  |&lt;BR /&gt;+---------------------------------------------------------------------------------------------------------------------+--+&lt;/P&gt;&lt;P&gt;In the location section, we have the HDFS path for this table.&lt;/P&gt;&lt;P&gt;Our current problem is:&lt;/P&gt;&lt;P&gt;if the above output folder (&lt;STRONG&gt;'hdfs://titan/dev/10112/app/TC30/dataiku/CONFIG_ANOTHER_TEST/output' ) &lt;/STRONG&gt;does not exist, insert overwrite &lt;/P&gt;&lt;P&gt;will fail: &lt;/P&gt;&lt;P&gt;INFO: Loading data to table
dev_tc30_dataiku.config_another_test_output from
hdfs://titan/tmp/.hive-staging_hive_2018-11-21_10-45-41_452_43360044430205414-24417/-ext-10000&lt;/P&gt;&lt;P&gt;ERROR :
Failed with exception Destination directory
hdfs://titan/dev/10112/app/TC30/dataiku/CONFIG_ANOTHER_TEST/output has not be
cleaned up.&lt;/P&gt;&lt;P&gt;org.apache.hadoop.hive.ql.metadata.HiveException:
Destination directory
hdfs://titan/dev/10112/app/TC30/dataiku/CONFIG_ANOTHER_TEST/output has not be
cleaned up.&lt;/P&gt;&lt;P&gt;at org.apache.hadoop.hive.ql.metadata.Hive.replaceFiles(Hive.java:3380)&lt;/P&gt;&lt;P&gt;at
org.apache.hadoop.hive.ql.metadata.Hive.loadTable(Hive.java:1895)&lt;/P&gt;&lt;P&gt;at
org.apache.hadoop.hive.ql.exec.MoveTask.execute(MoveTask.java:373)&lt;/P&gt;&lt;P&gt;at
org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:162)&lt;/P&gt;&lt;P&gt;at
org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:89)&lt;/P&gt;&lt;P&gt;at
org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1756)&lt;/P&gt;&lt;P&gt;at
org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1497)&lt;/P&gt;&lt;P&gt;at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1294)&lt;/P&gt;&lt;P&gt;at
org.apache.hadoop.hive.ql.Driver.run(Driver.java:1161)&lt;/P&gt;&lt;P&gt;at
org.apache.hadoop.hive.ql.Driver.run(Driver.java:1156)&lt;/P&gt;&lt;P&gt;at
org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:197)&lt;/P&gt;&lt;P&gt;at
org.apache.hive.service.cli.operation.SQLOperation.access$300(SQLOperation.java:76)&lt;/P&gt;&lt;P&gt;at
org.apache.hive.service.cli.operation.SQLOperation$2$1.run(SQLOperation.java:255)&lt;/P&gt;&lt;P&gt;at
java.security.AccessController.doPrivileged(Native Method)&lt;/P&gt;&lt;P&gt;at
javax.security.auth.Subject.doAs(Subject.java:422)&lt;/P&gt;&lt;P&gt;at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1866)&lt;/P&gt;&lt;P&gt;at org.apache.hive.service.cli.operation.SQLOperation$2.run(SQLOperation.java:266)&lt;/P&gt;&lt;P&gt;at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)&lt;/P&gt;&lt;P&gt;at
java.util.concurrent.FutureTask.run(FutureTask.java:266)&lt;/P&gt;&lt;P&gt;at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)&lt;/P&gt;&lt;P&gt;at
java.util.concurrent.FutureTask.run(FutureTask.java:266)&lt;/P&gt;&lt;P&gt;at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)&lt;/P&gt;&lt;P&gt;at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)&lt;/P&gt;&lt;P&gt;at java.lang.Thread.run(Thread.java:748)&lt;/P&gt;&lt;P&gt;Error: Error
while processing statement: FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.MoveTask (state=08S01,code=1)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Our question is: what is the default behavior of insert overwrite if the folder does not exist? should insert overwrite create the folder if the folder does not exist? is this an issue for hive 1.2?&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;Thanks for all the helps.&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
    <pubDate>Thu, 22 Nov 2018 01:38:57 GMT</pubDate>
    <dc:creator>dahai_long</dc:creator>
    <dc:date>2018-11-22T01:38:57Z</dc:date>
  </channel>
</rss>

