<?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 SHOW CREATE VIEW fails for owner in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/SHOW-CREATE-VIEW-fails-for-owner/m-p/77174#M80912</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're strugling with the issue that Impala does not provide access to SHOW CREATE VIEW statement for the owner of the view (as well as owner of underlying table). Sentry based authorization is used.&lt;BR /&gt;The documentation (&lt;A href="https://www.cloudera.com/documentation/enterprise/5-14-x/topics/impala_show.html#show_create_view" target="_blank"&gt;https://www.cloudera.com/documentation/enterprise/5-14-x/topics/impala_show.html#show_create_view&lt;/A&gt;) states that the required privileges should be: VIEW_METADATA privilege on the view and SELECT privilege on all underlying views and tables.&lt;/P&gt;&lt;P&gt;In our case the user owns the view and table, therefore, I expect both are fulfilled.&lt;/P&gt;&lt;P&gt;As you could see in the log below, the user has created, selected and dropped the view, but he couldn't see the&amp;nbsp;CREATE statement.&lt;/P&gt;&lt;P&gt;Invalidate metadata was tried too.&lt;BR /&gt;Could you kindly help to resolve the issue, so that developers could check the CREATE statements - is there a missing bit or is it a bug?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Environment:&lt;BR /&gt;CDH 5.14.2&lt;BR /&gt;Impala 2.11.0&lt;BR /&gt;LDAP authentication&lt;BR /&gt;Sentry file authorization&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here&amp;nbsp;is the log from different aspects:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;=== Sentry file ========&lt;BR /&gt;[users]&lt;BR /&gt;svc.analyticaldata_dq=analytical_data, ...&lt;BR /&gt;...&lt;BR /&gt;[groups]&lt;BR /&gt;analytical_data=analytical_data&lt;BR /&gt;...&lt;BR /&gt;[roles]&lt;BR /&gt;analytical_data=server=server1-&amp;gt;db=analytical_data&lt;BR /&gt;...&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;=== Impala CLI =============&lt;BR /&gt;[node009:21000] &amp;gt; select version();&lt;BR /&gt;Query: select version()&lt;BR /&gt;+-------------------------------------------------------------------------------------------+&lt;BR /&gt;| version() |&lt;BR /&gt;+-------------------------------------------------------------------------------------------+&lt;BR /&gt;| impalad version 2.11.0-cdh5.14.2 RELEASE (build ed85dce709da9557aeb28be89e8044947708876c) |&lt;BR /&gt;| Built on Tue Mar 27 13:39:48 PDT 2018 |&lt;BR /&gt;+-------------------------------------------------------------------------------------------+&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; select user();&lt;BR /&gt;Query: select user()&lt;BR /&gt;Query submitted at: 2018-07-19 15:30:16 (Coordinator: &lt;A href="http://node009:25000" target="_blank"&gt;http://node009:25000&lt;/A&gt;)&lt;BR /&gt;Query progress can be monitored at: &lt;A href="http://node009:25000/query_plan?query_id=1e4cc7a8258b79ff:e58adb9100000000" target="_blank"&gt;http://node009:25000/query_plan?query_id=1e4cc7a8258b79ff:e58adb9100000000&lt;/A&gt;&lt;BR /&gt;+-----------------------+&lt;BR /&gt;| user() |&lt;BR /&gt;+-----------------------+&lt;BR /&gt;| svc.analyticaldata_dq |&lt;BR /&gt;+-----------------------+&lt;BR /&gt;Fetched 1 row(s) in 0.08s&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; use analytical_data;&lt;BR /&gt;Query: use analytical_data&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; create view t as select count(*) from system9999.cases;&lt;BR /&gt;Query: create view t as select count(*) from system9999.cases&lt;BR /&gt;Query submitted at: 2018-07-19 15:24:52 (Coordinator: &lt;A href="http://node009:25000" target="_blank"&gt;http://node009:25000&lt;/A&gt;)&lt;BR /&gt;Query progress can be monitored at: &lt;A href="http://node009:25000/query_plan?query_id=304454e5a834396a:c1fbf50a00000000" target="_blank"&gt;http://node009:25000/query_plan?query_id=304454e5a834396a:c1fbf50a00000000&lt;/A&gt;&lt;BR /&gt;Fetched 0 row(s) in 0.08s&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; select * from t;&lt;BR /&gt;Query: select * from t&lt;BR /&gt;Query submitted at: 2018-07-19 15:24:55 (Coordinator: &lt;A href="http://node009:25000" target="_blank"&gt;http://node009:25000&lt;/A&gt;)&lt;BR /&gt;Query progress can be monitored at: &lt;A href="http://node009:25000/query_plan?query_id=27459f84b4308766:6ed0235200000000" target="_blank"&gt;http://node009:25000/query_plan?query_id=27459f84b4308766:6ed0235200000000&lt;/A&gt;&lt;BR /&gt;+---------+&lt;BR /&gt;| _c0 |&lt;BR /&gt;+---------+&lt;BR /&gt;| 6609331 |&lt;BR /&gt;+---------+&lt;BR /&gt;Fetched 1 row(s) in 4.50s&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; show create view t;&lt;BR /&gt;Query: show create view t&lt;BR /&gt;ERROR: AuthorizationException: User 'svc.analyticaldata_dq' does not have privileges to see the definition of view 'analytical_data.t'.&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; drop view t;&lt;BR /&gt;Query: drop view t&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;=== Metastore =============&lt;BR /&gt;[metastore]&amp;gt; select TBL_ID,TBL_NAME,OWNER,TBL_TYPE from TBLS where DB_ID=374406;&lt;BR /&gt;&lt;BR /&gt;+---------+--------------------------------------------+-----------------------+---------------+&lt;BR /&gt;| TBL_ID | TBL_NAME | OWNER | TBL_TYPE |&lt;BR /&gt;+---------+--------------------------------------------+-----------------------+---------------+&lt;BR /&gt;| 1222804 | t | svc.analyticaldata_dq | VIRTUAL_VIEW |&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 13:29:08 GMT</pubDate>
    <dc:creator>Andreyeff</dc:creator>
    <dc:date>2022-09-16T13:29:08Z</dc:date>
    <item>
      <title>SHOW CREATE VIEW fails for owner</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/SHOW-CREATE-VIEW-fails-for-owner/m-p/77174#M80912</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're strugling with the issue that Impala does not provide access to SHOW CREATE VIEW statement for the owner of the view (as well as owner of underlying table). Sentry based authorization is used.&lt;BR /&gt;The documentation (&lt;A href="https://www.cloudera.com/documentation/enterprise/5-14-x/topics/impala_show.html#show_create_view" target="_blank"&gt;https://www.cloudera.com/documentation/enterprise/5-14-x/topics/impala_show.html#show_create_view&lt;/A&gt;) states that the required privileges should be: VIEW_METADATA privilege on the view and SELECT privilege on all underlying views and tables.&lt;/P&gt;&lt;P&gt;In our case the user owns the view and table, therefore, I expect both are fulfilled.&lt;/P&gt;&lt;P&gt;As you could see in the log below, the user has created, selected and dropped the view, but he couldn't see the&amp;nbsp;CREATE statement.&lt;/P&gt;&lt;P&gt;Invalidate metadata was tried too.&lt;BR /&gt;Could you kindly help to resolve the issue, so that developers could check the CREATE statements - is there a missing bit or is it a bug?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Environment:&lt;BR /&gt;CDH 5.14.2&lt;BR /&gt;Impala 2.11.0&lt;BR /&gt;LDAP authentication&lt;BR /&gt;Sentry file authorization&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here&amp;nbsp;is the log from different aspects:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;=== Sentry file ========&lt;BR /&gt;[users]&lt;BR /&gt;svc.analyticaldata_dq=analytical_data, ...&lt;BR /&gt;...&lt;BR /&gt;[groups]&lt;BR /&gt;analytical_data=analytical_data&lt;BR /&gt;...&lt;BR /&gt;[roles]&lt;BR /&gt;analytical_data=server=server1-&amp;gt;db=analytical_data&lt;BR /&gt;...&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;=== Impala CLI =============&lt;BR /&gt;[node009:21000] &amp;gt; select version();&lt;BR /&gt;Query: select version()&lt;BR /&gt;+-------------------------------------------------------------------------------------------+&lt;BR /&gt;| version() |&lt;BR /&gt;+-------------------------------------------------------------------------------------------+&lt;BR /&gt;| impalad version 2.11.0-cdh5.14.2 RELEASE (build ed85dce709da9557aeb28be89e8044947708876c) |&lt;BR /&gt;| Built on Tue Mar 27 13:39:48 PDT 2018 |&lt;BR /&gt;+-------------------------------------------------------------------------------------------+&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; select user();&lt;BR /&gt;Query: select user()&lt;BR /&gt;Query submitted at: 2018-07-19 15:30:16 (Coordinator: &lt;A href="http://node009:25000" target="_blank"&gt;http://node009:25000&lt;/A&gt;)&lt;BR /&gt;Query progress can be monitored at: &lt;A href="http://node009:25000/query_plan?query_id=1e4cc7a8258b79ff:e58adb9100000000" target="_blank"&gt;http://node009:25000/query_plan?query_id=1e4cc7a8258b79ff:e58adb9100000000&lt;/A&gt;&lt;BR /&gt;+-----------------------+&lt;BR /&gt;| user() |&lt;BR /&gt;+-----------------------+&lt;BR /&gt;| svc.analyticaldata_dq |&lt;BR /&gt;+-----------------------+&lt;BR /&gt;Fetched 1 row(s) in 0.08s&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; use analytical_data;&lt;BR /&gt;Query: use analytical_data&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; create view t as select count(*) from system9999.cases;&lt;BR /&gt;Query: create view t as select count(*) from system9999.cases&lt;BR /&gt;Query submitted at: 2018-07-19 15:24:52 (Coordinator: &lt;A href="http://node009:25000" target="_blank"&gt;http://node009:25000&lt;/A&gt;)&lt;BR /&gt;Query progress can be monitored at: &lt;A href="http://node009:25000/query_plan?query_id=304454e5a834396a:c1fbf50a00000000" target="_blank"&gt;http://node009:25000/query_plan?query_id=304454e5a834396a:c1fbf50a00000000&lt;/A&gt;&lt;BR /&gt;Fetched 0 row(s) in 0.08s&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; select * from t;&lt;BR /&gt;Query: select * from t&lt;BR /&gt;Query submitted at: 2018-07-19 15:24:55 (Coordinator: &lt;A href="http://node009:25000" target="_blank"&gt;http://node009:25000&lt;/A&gt;)&lt;BR /&gt;Query progress can be monitored at: &lt;A href="http://node009:25000/query_plan?query_id=27459f84b4308766:6ed0235200000000" target="_blank"&gt;http://node009:25000/query_plan?query_id=27459f84b4308766:6ed0235200000000&lt;/A&gt;&lt;BR /&gt;+---------+&lt;BR /&gt;| _c0 |&lt;BR /&gt;+---------+&lt;BR /&gt;| 6609331 |&lt;BR /&gt;+---------+&lt;BR /&gt;Fetched 1 row(s) in 4.50s&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; show create view t;&lt;BR /&gt;Query: show create view t&lt;BR /&gt;ERROR: AuthorizationException: User 'svc.analyticaldata_dq' does not have privileges to see the definition of view 'analytical_data.t'.&lt;BR /&gt;&lt;BR /&gt;[node009:21000] &amp;gt; drop view t;&lt;BR /&gt;Query: drop view t&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;=== Metastore =============&lt;BR /&gt;[metastore]&amp;gt; select TBL_ID,TBL_NAME,OWNER,TBL_TYPE from TBLS where DB_ID=374406;&lt;BR /&gt;&lt;BR /&gt;+---------+--------------------------------------------+-----------------------+---------------+&lt;BR /&gt;| TBL_ID | TBL_NAME | OWNER | TBL_TYPE |&lt;BR /&gt;+---------+--------------------------------------------+-----------------------+---------------+&lt;BR /&gt;| 1222804 | t | svc.analyticaldata_dq | VIRTUAL_VIEW |&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:29:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/SHOW-CREATE-VIEW-fails-for-owner/m-p/77174#M80912</guid>
      <dc:creator>Andreyeff</dc:creator>
      <dc:date>2022-09-16T13:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: SHOW CREATE VIEW fails for owner</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/SHOW-CREATE-VIEW-fails-for-owner/m-p/77179#M80913</link>
      <description>&lt;P&gt;&lt;EM&gt;In our case the user owns the view and table, therefore, I expect both are fulfilled.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Object ownership&amp;nbsp;is not currently supported in Impala.&amp;nbsp;However, we are currently working on it:&amp;nbsp;&lt;A href="https://issues.apache.org/jira/browse/IMPALA-7075" target="_blank"&gt;https://issues.apache.org/jira/browse/IMPALA-7075&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;To be able to execute SHOW CREATE VIEW, you need access to the view as well as the underlying table(s). In your particular example, you need to have access to both "t" and "system9999.cases". This is because SHOW CREATE VIEW will reveal the information on the underlying table(s). Hence, the need to have access to&amp;nbsp;the underlying table(s). This is different than&amp;nbsp;other statements, such as SELECT, DROP, etc that require no information on the underlying table(s).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, there seems to be a bug with SHOW CREATE VIEW&amp;nbsp;that&amp;nbsp;references bulit-in functions, such as "count", etc. I filed a bug&amp;nbsp;in&amp;nbsp;&lt;A href="https://issues.apache.org/jira/browse/IMPALA-7325" target="_blank"&gt;https://issues.apache.org/jira/browse/IMPALA-7325&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 17:51:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/SHOW-CREATE-VIEW-fails-for-owner/m-p/77179#M80913</guid>
      <dc:creator>fwijaya</dc:creator>
      <dc:date>2018-07-19T17:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: SHOW CREATE VIEW fails for owner</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/SHOW-CREATE-VIEW-fails-for-owner/m-p/77202#M80914</link>
      <description>Oh, the issue appeared to be even in functions.&lt;BR /&gt;Thanks for fast reply and raising a ticket.</description>
      <pubDate>Fri, 20 Jul 2018 06:56:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/SHOW-CREATE-VIEW-fails-for-owner/m-p/77202#M80914</guid>
      <dc:creator>Andreyeff</dc:creator>
      <dc:date>2018-07-20T06:56:07Z</dc:date>
    </item>
  </channel>
</rss>

