<?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: In Spark  3.1.1 , Failed while InsertInto with dynamic partition for External Table in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/321579#M228459</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/90633"&gt;@DURAISAM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are not able to execute "Insert Into" command only or not able to perform other actions as well, say "Delete", etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you check if the user with which you are updating/ querying the table has required permissions on the table&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jul 2021 14:31:16 GMT</pubDate>
    <dc:creator>jAnshula</dc:creator>
    <dc:date>2021-07-26T14:31:16Z</dc:date>
    <item>
      <title>In Spark  3.1.1 , Failed while InsertInto with dynamic partition for External Table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/321572#M228452</link>
      <description>&lt;PRE&gt;set hive.exec.dynamic.partition=&lt;SPAN class="code-keyword"&gt;true&lt;/SPAN&gt;;
set hive.exec.dynamic.partition.mode=nostrict;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;dataset.write.mode("overwrite").InsertInto("table") with dynamic partitions&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried in spark program and also in SPARK3-SHELL&lt;/P&gt;&lt;PRE&gt;ERROR Hive: Exception when loading partition with parameters  partPath=hdfs:&lt;SPAN class="code-comment"&gt;//nameservice/user/hive/warehouse/tmp.db/id_name2/.hive-staging_hive_2020-08-05_14-38-00_715_3629476922121193803-1/-ext-10000/dt=2001,  table=id_name2,  partSpec={dt=2001},  loadFileType=REPLACE_ALL,  listBucketingLevel=0,  isAcid=&lt;SPAN class="code-keyword"&gt;false&lt;/SPAN&gt;,  resetStatistics=&lt;SPAN class="code-keyword"&gt;false&lt;/SPAN&gt;
&lt;/SPAN&gt;org.apache.hadoop.hive.ql.metadata.HiveException: Directory hdfs:&lt;SPAN class="code-comment"&gt;//nameservice/user/hive/warehouse/tmp.db/id_name2/dt=2001 could not be cleaned up.&lt;/SPAN&gt;    at org.apache.hadoop.hive.ql.metadata.Hive.deleteOldPathForReplace(Hive.java:4666)
    at org.apache.hadoop.hive.ql.metadata.Hive.replaceFiles(Hive.java:4597)
    at org.apache.hadoop.hive.ql.metadata.Hive.loadPartition(Hive.java:2132)
    at org.apache.hadoop.hive.ql.metadata.Hive$5.call(Hive.java:2588)
    at org.apache.hadoop.hive.ql.metadata.Hive$5.call(Hive.java:2579)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.&lt;SPAN class="code-object"&gt;Thread&lt;/SPAN&gt;.run(&lt;SPAN class="code-object"&gt;Thread&lt;/SPAN&gt;.java:748)
Caused by: java.io.FileNotFoundException: File hdfs:&lt;SPAN class="code-comment"&gt;//nameservice/user/hive/warehouse/tmp.db/id_name2/dt=2001 does not exist.&lt;/SPAN&gt;    at org.apache.hadoop.hdfs.DistributedFileSystem.listStatusInternal(DistributedFileSystem.java:1053)
    at org.apache.hadoop.hdfs.DistributedFileSystem.access$1000(DistributedFileSystem.java:131)
    at org.apache.hadoop.hdfs.DistributedFileSystem$24.doCall(DistributedFileSystem.java:1113)
    at org.apache.hadoop.hdfs.DistributedFileSystem$24.doCall(DistributedFileSystem.java:1110)
    at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs.DistributedFileSystem.listStatus(DistributedFileSystem.java:1120)
    at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1868)
    at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1910)
    at org.apache.hadoop.hive.ql.metadata.Hive.cleanUpOneDirectoryForReplace(Hive.java:4681)
    at org.apache.hadoop.hive.ql.metadata.Hive.deleteOldPathForReplace(Hive.java:4661)
    ... 8 more
Error in query: org.apache.hadoop.hive.ql.metadata.HiveException: Exception when loading 1 in table id_name2 with loadPath=hdfs:&lt;SPAN class="code-comment"&gt;//nameservice/user/hive/warehouse/tmp.db/id_name2/.hive-staging_hive_2020-08-05_14-38-00_715_3629476922121193803-1/-ext-10000;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 13:32:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/321572#M228452</guid>
      <dc:creator>DURAISAM</dc:creator>
      <dc:date>2021-07-26T13:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: In Spark  3.1.1 , Failed while InsertInto with dynamic partition for External Table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/321579#M228459</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/90633"&gt;@DURAISAM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are not able to execute "Insert Into" command only or not able to perform other actions as well, say "Delete", etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you check if the user with which you are updating/ querying the table has required permissions on the table&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 14:31:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/321579#M228459</guid>
      <dc:creator>jAnshula</dc:creator>
      <dc:date>2021-07-26T14:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: In Spark  3.1.1 , Failed while InsertInto with dynamic partition for External Table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/321607#M228473</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@&lt;A href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/81584" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;jAnshula&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Tried and checked&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Permission of folder all fine in HDFS&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;spark.sql.files.ignoreMissingFiles=true&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;spark.sql.sources.partitionOverwriteMode=DYNAMIC&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Works fine in Spark 2.4&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Facing the issue in Spark 3.1.1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;dataset.write.mode("overwrite").insertInto("external_table"); this should remove existing partitions and persists new data right?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Actual&lt;/STRONG&gt;: On Rerun case,&amp;nbsp; Data got removed from HDFS and still partition details in table metadata so trying again to remove the data and throws FileNotFoundException.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To reproduce very quickly, please check once in spark3-shell .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 04:10:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/321607#M228473</guid>
      <dc:creator>DURAISAM</dc:creator>
      <dc:date>2021-07-27T04:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: In Spark  3.1.1 , Failed while InsertInto with dynamic partition for External Table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/321620#M228481</link>
      <description>&lt;P&gt;what's the Ambari/ CM version you are using, Also can you share us the HMS logs for this time range&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 08:45:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/321620#M228481</guid>
      <dc:creator>jAnshula</dc:creator>
      <dc:date>2021-07-27T08:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: In Spark  3.1.1 , Failed while InsertInto with dynamic partition for External Table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/322629#M228883</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am going with workaround as of now for this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Workaround: Drop partition explicit via code from metadata&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 13:13:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-Spark-3-1-1-Failed-while-InsertInto-with-dynamic/m-p/322629#M228883</guid>
      <dc:creator>DURAISAM</dc:creator>
      <dc:date>2021-08-16T13:13:57Z</dc:date>
    </item>
  </channel>
</rss>

