<?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 unexpected error while adding partitions in hive partitioned view in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/unexpected-error-while-adding-partitions-in-hive-partitioned/m-p/41281#M29566</link>
    <description>&lt;P&gt;I am trying to create partitioned view on top of a hive partitioned table, but while executing alter view to add partition info in view hive is giving unexpected error with very brief &amp;amp; vague error message. Below is the ddl of partitioned table (a_part) &amp;amp; partitioned view (a_part_view) and info of partition present in table.&lt;BR /&gt;&lt;SPAN&gt;So when i am trying to add partition in view, it gives me below error, both properties (hive.mapred.mode &amp;amp; hive.exec.dynamic.partition.mode) are set to nonstrict.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;CREATE TABLE a_part (col1 int, col2 string, col3 date) PARTITIONED BY (dt string) STORED AS ORC;CREATE VIEW a_part_view (col1, col2, col3, dt)
PARTITIONED ON (dt)
AS SELECT col1, col2, col3, dt FROM a_part;
0: jdbc:hive2://cdhdata2:10000/default&amp;gt; show partitions a_part;
+--------------+--+
|  partition   |
+--------------+--+
| dt=20160515  |
| dt=20160516  |
| dt=20160517  |
+--------------+--+

0: jdbc:hive2://cdhdata2:10000/default&amp;gt; ALTER VIEW a_part_view ADD PARTITION (dt='20160515');
Error: Error while compiling statement: FAILED: SemanticException [Error 10056]: The query does not reference any valid partition. To run this query, set hive.mapred.mode=nonstrict (state=42000,code=10056)&lt;/PRE&gt;&lt;P&gt;So am i missing or doing some thing wrong, It would be really helpful if somebody shed more light on this.&lt;/P&gt;&lt;P&gt;Stack info: CDH 5.5.2, Apache hive (Hive 1.1.0-cdh5.5.2), kerberos &amp;amp; sentry enabled.&lt;/P&gt;&lt;P&gt;p.s: drop partition command is working fine (although there isn't a partition to drop):&lt;/P&gt;&lt;PRE&gt;0: jdbc:hive2://cdhdata2:10000/default&amp;gt; ALTER VIEW a_part_view drop PARTITION (dt='20160515');
No rows affected (0.106 seconds)&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Sep 2022 10:21:44 GMT</pubDate>
    <dc:creator>deepakgiria</dc:creator>
    <dc:date>2022-09-16T10:21:44Z</dc:date>
    <item>
      <title>unexpected error while adding partitions in hive partitioned view</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/unexpected-error-while-adding-partitions-in-hive-partitioned/m-p/41281#M29566</link>
      <description>&lt;P&gt;I am trying to create partitioned view on top of a hive partitioned table, but while executing alter view to add partition info in view hive is giving unexpected error with very brief &amp;amp; vague error message. Below is the ddl of partitioned table (a_part) &amp;amp; partitioned view (a_part_view) and info of partition present in table.&lt;BR /&gt;&lt;SPAN&gt;So when i am trying to add partition in view, it gives me below error, both properties (hive.mapred.mode &amp;amp; hive.exec.dynamic.partition.mode) are set to nonstrict.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;CREATE TABLE a_part (col1 int, col2 string, col3 date) PARTITIONED BY (dt string) STORED AS ORC;CREATE VIEW a_part_view (col1, col2, col3, dt)
PARTITIONED ON (dt)
AS SELECT col1, col2, col3, dt FROM a_part;
0: jdbc:hive2://cdhdata2:10000/default&amp;gt; show partitions a_part;
+--------------+--+
|  partition   |
+--------------+--+
| dt=20160515  |
| dt=20160516  |
| dt=20160517  |
+--------------+--+

0: jdbc:hive2://cdhdata2:10000/default&amp;gt; ALTER VIEW a_part_view ADD PARTITION (dt='20160515');
Error: Error while compiling statement: FAILED: SemanticException [Error 10056]: The query does not reference any valid partition. To run this query, set hive.mapred.mode=nonstrict (state=42000,code=10056)&lt;/PRE&gt;&lt;P&gt;So am i missing or doing some thing wrong, It would be really helpful if somebody shed more light on this.&lt;/P&gt;&lt;P&gt;Stack info: CDH 5.5.2, Apache hive (Hive 1.1.0-cdh5.5.2), kerberos &amp;amp; sentry enabled.&lt;/P&gt;&lt;P&gt;p.s: drop partition command is working fine (although there isn't a partition to drop):&lt;/P&gt;&lt;PRE&gt;0: jdbc:hive2://cdhdata2:10000/default&amp;gt; ALTER VIEW a_part_view drop PARTITION (dt='20160515');
No rows affected (0.106 seconds)&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:21:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/unexpected-error-while-adding-partitions-in-hive-partitioned/m-p/41281#M29566</guid>
      <dc:creator>deepakgiria</dc:creator>
      <dc:date>2022-09-16T10:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected error while adding partitions in hive partitioned view</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/unexpected-error-while-adding-partitions-in-hive-partitioned/m-p/41294#M29567</link>
      <description>&lt;P&gt;I was following backdated documentation, views doesn't have partitioned on clause and hive compiler take care of partition pruning on underlying table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2016 08:45:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/unexpected-error-while-adding-partitions-in-hive-partitioned/m-p/41294#M29567</guid>
      <dc:creator>deepakgiria</dc:creator>
      <dc:date>2016-05-25T08:45:50Z</dc:date>
    </item>
  </channel>
</rss>

