<?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: HDP 3 Hive: create view if not exists fails in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231043#M82632</link>
    <description>&lt;P style="margin-left: 20px;"&gt;Hi Geofffrey, yes the view already exists, but "if not exists" should suppress the error, no matter if which database I'm on. This works fine in HDP 2.6 (Hive 1.2) but does not work in HDP 3.0 (Hive 3.1.0.3.0.0.0-1634) anymore.&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;If I create a new database "max", your example will fail the second time I call "create view if not exists test20 as select 1;"&lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2018 22:01:38 GMT</pubDate>
    <dc:creator>flashacid</dc:creator>
    <dc:date>2018-08-24T22:01:38Z</dc:date>
    <item>
      <title>HDP 3 Hive: create view if not exists fails</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231041#M82630</link>
      <description>&lt;P&gt;
	After upgrading to HDP 3.0, I can't run my queries anymore. It seems that "if not exists" is ignored in "create view".&lt;/P&gt;&lt;P&gt;
	Example:&lt;/P&gt;&lt;PRE&gt;create view if not exists test as select 1;
create view if not exists test as select 1;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second call will fail with:&lt;/P&gt;&lt;PRE&gt;INFO  : Starting task [Stage-1:DDL] in serial mode
ERROR : FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Table already exists: default.test
INFO  : Completed executing command(queryId=hive_20180824114455_907fb7eb-d05a-4831-8482-4f0f3d761721); Time taken: 0.031 seconds&lt;/PRE&gt;&lt;P&gt;Restarting hiveserver2 and beeline does not help.&lt;/P&gt;&lt;P&gt;Does anybody else has this problem?&lt;/P&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Aug 2018 18:46:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231041#M82630</guid>
      <dc:creator>flashacid</dc:creator>
      <dc:date>2018-08-24T18:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: HDP 3 Hive: create view if not exists fails</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231042#M82631</link>
      <description>&lt;P&gt;&lt;A href="@M Ax"&gt;&lt;EM&gt;@M Ax&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;It seems to me you are connected to the default hive database and trying to create a  view which already exists in that database  can you change the SQL to&lt;/I&gt;&lt;/P&gt;&lt;PRE&gt;create view if not exists test20 as select1;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Or just run the below to validate create a test database&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;Create database  max;
use max;
create view if not exists test20 as select1;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;If the above runs fine then it will confirm your initial error was due to the existing object (view test) in the default database.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;HTH&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 19:01:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231042#M82631</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2018-08-24T19:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: HDP 3 Hive: create view if not exists fails</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231043#M82632</link>
      <description>&lt;P style="margin-left: 20px;"&gt;Hi Geofffrey, yes the view already exists, but "if not exists" should suppress the error, no matter if which database I'm on. This works fine in HDP 2.6 (Hive 1.2) but does not work in HDP 3.0 (Hive 3.1.0.3.0.0.0-1634) anymore.&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;If I create a new database "max", your example will fail the second time I call "create view if not exists test20 as select 1;"&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 22:01:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231043#M82632</guid>
      <dc:creator>flashacid</dc:creator>
      <dc:date>2018-08-24T22:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: HDP 3 Hive: create view if not exists fails</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231044#M82633</link>
      <description>&lt;P&gt;This is a bug (confirmed that this exist on upstream/apache master as well). Please go ahead and open a bug on apache hive (Or let me know and I can do that)&lt;/P&gt;</description>
      <pubDate>Sat, 25 Aug 2018 05:53:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231044#M82633</guid>
      <dc:creator>vgarg</dc:creator>
      <dc:date>2018-08-25T05:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: HDP 3 Hive: create view if not exists fails</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231045#M82634</link>
      <description>&lt;P&gt;Thanks, issue created: &lt;A href="https://issues.apache.org/jira/browse/HIVE-20462" target="_blank"&gt;https://issues.apache.org/jira/browse/HIVE-20462&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Aug 2018 16:18:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-3-Hive-create-view-if-not-exists-fails/m-p/231045#M82634</guid>
      <dc:creator>flashacid</dc:creator>
      <dc:date>2018-08-25T16:18:33Z</dc:date>
    </item>
  </channel>
</rss>

