<?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: UDF reflect is not allowed - beeline in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/UDF-reflect-is-not-allowed-beeline/m-p/155076#M117515</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Symptom&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Not able to use reflect function using beeline, but the query works OK with Hvi CLI.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error Message:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Error while compiling statement: FAILED: SemanticException UDF reflect is not allowed (state=42000,code=40000)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cause&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When running &lt;EM&gt;set hive.server2.builtin.udf.blacklist&lt;/EM&gt; from beeline, it will return the following as blacklisted:&lt;/P&gt;&lt;PRE&gt;jdbc:hive2://localhost:10000/default&amp;gt; set hive.server2.builtin.udf.blacklist;&lt;BR /&gt;
+------------------------------------------------------------------+--+&lt;BR /&gt;
| set |&lt;BR /&gt;
+------------------------------------------------------------------+--+&lt;BR /&gt;
| hive.server2.builtin.udf.blacklist=reflect,reflect2,java_method |&lt;BR /&gt;
+------------------------------------------------------------------+--+&lt;/PRE&gt;&lt;P&gt;Reflect UDF is blacklisted by default when running queries through HiveServer2 (beeline, ODBC, JDBC connections), as it was found to be a security risk. &lt;/P&gt;&lt;P&gt;The &lt;A href="https://github.com/apache/hive/blob/ff67cdda1c538dc65087878eeba3e165cf3230f4/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/SettableConfigUpdater.java"&gt;code&lt;/A&gt; was modified so if the parameter hive.server2.builtin.udf.blacklist has not been configured or it is blank, its default value will be &lt;CODE&gt;"reflect,reflect2,java_method".&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resolution&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Open the Ambari UI&lt;/P&gt;&lt;P&gt;2. Add the custom property in Ambari hive.server2.builtin.udf.blacklist under Hive / Configs / Advanced / Custom hive-site and give it any value, for example "empty_blacklist".&lt;/P&gt;&lt;P&gt;3. Restart services as requested by Ambari.&lt;/P&gt;&lt;P&gt;4. Connect again with beeline and verify that blacklist only includes the dummy value now.&lt;/P&gt;&lt;PRE&gt;0: jdbc:hive2://localhost:10000/default&amp;gt; set hive.server2.builtin.udf.blacklist;&lt;BR /&gt;+-------------------------------------------+--+&lt;BR /&gt;
| hive.server2.builtin.udf.blacklist=empty_blacklist |&lt;BR /&gt;
+-------------------------------------------+--+
&lt;/PRE&gt;&lt;P&gt;5. Reflect should work now without issues.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2017 17:58:40 GMT</pubDate>
    <dc:creator>oleggorj</dc:creator>
    <dc:date>2017-09-06T17:58:40Z</dc:date>
  </channel>
</rss>

