<?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 Re: Hive query on prem writing to S3 fails bc of return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-query-on-prem-writing-to-S3-fails-bc-of-return-code-1/m-p/217040#M74493</link>
    <description>&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;See if you can write to folder inside the bucket rather than directly writing into root level bucket.&lt;/P&gt;&lt;P&gt;INSERT OVERWRITE DIRECTORY 's3a://demo/testdata'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
select*from demo_table;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2018 09:01:00 GMT</pubDate>
    <dc:creator>smunigati</dc:creator>
    <dc:date>2018-02-13T09:01:00Z</dc:date>
    <item>
      <title>Hive query on prem writing to S3 fails bc of return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-query-on-prem-writing-to-S3-fails-bc-of-return-code-1/m-p/217039#M74492</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;Issue I am having is this here, but setting the two configs are not working for me (seems it works for some and not others)  &lt;A href="https://forums.aws.amazon.com/message.jspa?messageID=768332"&gt;https://forums.aws.amazon.com/message.jspa?messageID=768332&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.aws.amazon.com/message.jspa?messageID=768332"&gt;&lt;/A&gt;Below is full description &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Goal:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am writing this test query with small data size to output results to S3.&lt;/P&gt;&lt;PRE&gt;INSERT OVERWRITE DIRECTORY 's3a://demo/'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
select * from demo_table;
&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Notes:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;This query runs when outputted to HDFS directory.&lt;/LI&gt;&lt;LI&gt;I can create an external table locally against s3 remotely.. so my configurations are working (CREATE EXTERNAL TABLE ... LOCATION 's3a://demo/'; works)&lt;/LI&gt;&lt;LI&gt;Only when outputing a query to s3 do I get a failure (below)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Error:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The error when attempting the query to output to S3 is:&lt;/P&gt;&lt;PRE&gt;2018-02-12 01:12:58,790 INFO  [HiveServer2-Background-Pool: Thread-363]: log.PerfLogger (PerfLogger.java:PerfLogEnd(177)) - &amp;lt;/PERFLOG method=releaseLocks start=1518397978790 end=1518397978790 duration=0 from=org.apache.hadoop.hive.ql.Driver&amp;gt;
2018-02-12 01:12:58,791 ERROR [HiveServer2-Background-Pool: Thread-363]: operation.Operation (SQLOperation.java:run(258)) - Error running hive query:
org.apache.hive.service.cli.HiveSQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
	at org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:324)
	at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:199)
	at org.apache.hive.service.cli.operation.SQLOperation.access$300(SQLOperation.java:76)
	at org.apache.hive.service.cli.operation.SQLOperation$2$1.run(SQLOperation.java:255)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1866)
	at org.apache.hive.service.cli.operation.SQLOperation$2.run(SQLOperation.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
2018-02-12 01:12:58,794 INFO  [HiveServer2-Handler-Pool: Thread-106]: session.HiveSessionImpl (HiveSessionImpl.java:acquireAfterOpLock(342)) - We are setting the hadoop caller context to 5e6f48a9-7014-4d15-b02c-579557b5fb98 for thread HiveServer2-Handler-Pool: Thread-106
&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Additional note:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The query writes the tmp files to 's3a://demo/'  but then fails with the above error.  Tmp files look like&lt;/P&gt;&lt;PRE&gt;[hdfs@gkeys0 centos]$ hdfs dfs -ls -R s3a://demo/&lt;/PRE&gt;&lt;PRE&gt;drwxrwxrwx   - hdfs hdfs          0 2018-02-12 02:12 s3a://demo/.hive-staging_hive_2018-02-12_02-08-27_090_2945283769634970656-1
drwxrwxrwx   - hdfs hdfs          0 2018-02-12 02:12 s3a://demo/.hive-staging_hive_2018-02-12_02-08-27_090_2945283769634970656-1/-ext-10000
-rw-rw-rw-   1 hdfs hdfs      38106 2018-02-12 02:09 s3a://demo/.hive-staging_hive_2018-02-12_02-08-27_090_2945283769634970656-1/-ext-10000/000000_0
-rw-rw-rw-   1 hdfs hdfs       6570 2018-02-12 02:09 s3a://demo/.hive-staging_hive_2018-02-12_02-08-27_090_2945283769634970656-1/-ext-10000/000001_0&lt;/PRE&gt;&lt;P&gt;Am I missing a config to set, or something like that?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 09:39:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-query-on-prem-writing-to-S3-fails-bc-of-return-code-1/m-p/217039#M74492</guid>
      <dc:creator>gkeys</dc:creator>
      <dc:date>2018-02-12T09:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Hive query on prem writing to S3 fails bc of return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-query-on-prem-writing-to-S3-fails-bc-of-return-code-1/m-p/217040#M74493</link>
      <description>&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;See if you can write to folder inside the bucket rather than directly writing into root level bucket.&lt;/P&gt;&lt;P&gt;INSERT OVERWRITE DIRECTORY 's3a://demo/testdata'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
select*from demo_table;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 09:01:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-query-on-prem-writing-to-S3-fails-bc-of-return-code-1/m-p/217040#M74493</guid>
      <dc:creator>smunigati</dc:creator>
      <dc:date>2018-02-13T09:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hive query on prem writing to S3 fails bc of return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-query-on-prem-writing-to-S3-fails-bc-of-return-code-1/m-p/217041#M74494</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/11920/smunigati.html" nodeid="11920"&gt;@Sreekanth  Munigati&lt;/A&gt; .. that worked!&lt;/P&gt;&lt;P&gt;s3a://demo/ does not work&lt;/P&gt;&lt;P&gt;s3a://demo/folder does!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 09:51:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-query-on-prem-writing-to-S3-fails-bc-of-return-code-1/m-p/217041#M74494</guid>
      <dc:creator>gkeys</dc:creator>
      <dc:date>2018-02-13T09:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Hive query on prem writing to S3 fails bc of return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-query-on-prem-writing-to-S3-fails-bc-of-return-code-1/m-p/217042#M74495</link>
      <description>&lt;P&gt;let's just say there's "ambiguity" about how root directories are treated in object stores and filesystems, and rename() is a key troublespot everywhere. It's known there are quirks here, but as normal s3/wasb/adl useage goes to subdirectories, nobody has ever sat down with HDFS to argue the subtleties of renaming something into the root directory&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 00:00:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Hive-query-on-prem-writing-to-S3-fails-bc-of-return-code-1/m-p/217042#M74495</guid>
      <dc:creator>stevel</dc:creator>
      <dc:date>2018-02-14T00:00:57Z</dc:date>
    </item>
  </channel>
</rss>

