<?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: creating materialized view getting below error? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242598#M204399</link>
    <description>&lt;P&gt;hi  @Geoffrey Shelton Okot,&lt;/P&gt;&lt;P&gt;iam able create to materialized view  for hive managed table ,but not external table ?&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2019 15:52:49 GMT</pubDate>
    <dc:creator>wamshikreshna</dc:creator>
    <dc:date>2019-06-17T15:52:49Z</dc:date>
    <item>
      <title>creating materialized view getting below error?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242593#M204394</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;Iam creating materialized view for a table ,for that getting below error.can any one help on this?&lt;/P&gt;&lt;P&gt; create materialized view car1_mv as select * from cars;&lt;/P&gt;&lt;P&gt;Error: Error while compiling statement: FAILED: SemanticException org.apache.hadoop.hive.ql.parse.SemanticException: Automatic rewriting for materialized view cannot be enabled if the materialized view uses non-transactional tables (state=42000,code=40000)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2019 21:01:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242593#M204394</guid>
      <dc:creator>wamshikreshna</dc:creator>
      <dc:date>2019-06-15T21:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: creating materialized view getting below error?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242594#M204395</link>
      <description>&lt;P&gt;&lt;A rel="noopener noreferrer noopener noreferrer" href="http://@choppadandi%20vamshi%20krishna" target="_blank"&gt;&lt;EM&gt;@choppadandi vamshi krishna&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;You can only create a materialized view on transactional tables. where changes in the base table will be logged and there is a refresh mechanism to update the materialized view whenever the view is queried&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please, can you check whether the base table is transactional? Below are steps to help you determine that. The assumption below is your table cars is in the default database.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# hive -e "describe extended &amp;lt;Database&amp;gt;.&amp;lt;tablename&amp;gt;;" | grep "transactional=true"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If you get an output with the string that you grep for, then the table is transactional &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Example:&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt; #hive -e "describe extended default.cars;" | grep "transactional=true"&lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Else Alter the flat table to make it transactional.&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt;ALTER TABLE cars SET TBLPROPERTIES ('transactional'='true'); &amp;nbsp;&lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Then try creating the materialized view again it should succeed&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please revert&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2019 21:16:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242594#M204395</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2019-06-15T21:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: creating materialized view getting below error?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242595#M204396</link>
      <description>&lt;P&gt;hi &lt;A rel="user" href="https://community.cloudera.com/users/1271/sheltong.html" nodeid="1271"&gt;@Geoffrey Shelton Okot&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks for the reply,&lt;/P&gt;&lt;P&gt;As per my understanding ,if we enable materialized views  the  table must have orc storage format and transnational,&lt;/P&gt;&lt;P&gt;my doubt is when we create different storage format other than orc like (avro,text etc) did we apply materialized views if it works? &lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2019 23:20:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242595#M204396</guid>
      <dc:creator>wamshikreshna</dc:creator>
      <dc:date>2019-06-15T23:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: creating materialized view getting below error?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242596#M204397</link>
      <description>&lt;P&gt;&lt;A rel="noopener noreferrer noopener noreferrer noopener noreferrer noopener noreferrer noopener noreferrer noopener noreferrer noopener noreferrer noopener noreferrer noopener noreferrer noopener noreferrer" href="http://@choppadandi%20vamshi%20krishna" target="_blank"&gt;&lt;EM&gt;@choppadandi vamshi krishna&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;With Hive 3.0 you have hive and druid storage options too and the &lt;STRONG&gt;orc&lt;/STRONG&gt; is the most common. I haven't tested and can't confirm whether it's possible to create an MV over Avro and refresh it a regular interval would work &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;You can also use the rebuild option to refresh the MV when scripting run the rebuild which will overwrite the previous mv before querying it so you have an updated &lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt;ALTER MATERIALIZED VIEW mv REBUILD;  &lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;You also have the Druid storage &lt;STRONG&gt;org &lt;/STRONG&gt;&lt;STRONG&gt;.apache.hadoop.hive.druid.DruidStorageHandler &lt;/STRONG&gt;or you can rebuild an MV like every 5 minutes but you should take into account that every rebuild will take longer than the previous due to the addition of data in the source table.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;HTH&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2019 00:52:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242596#M204397</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2019-06-16T00:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: creating materialized view getting below error?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242598#M204399</link>
      <description>&lt;P&gt;hi  @Geoffrey Shelton Okot,&lt;/P&gt;&lt;P&gt;iam able create to materialized view  for hive managed table ,but not external table ?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 15:52:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/242598#M204399</guid>
      <dc:creator>wamshikreshna</dc:creator>
      <dc:date>2019-06-17T15:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: creating materialized view getting below error?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/284599#M211317</link>
      <description>&lt;P&gt;Do you know my hive mv not incremental rebuild with druid storage handler?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 03:37:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/creating-materialized-view-getting-below-error/m-p/284599#M211317</guid>
      <dc:creator>anvanna</dc:creator>
      <dc:date>2019-12-03T03:37:57Z</dc:date>
    </item>
  </channel>
</rss>

