<?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: Error executing a hive UDF through jbdc in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100238#M13163</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1499/poojakhandelwal.html" nodeid="1499"&gt;@pooja khandelwal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;1- Create directory below in all hiveserver2 hosts:&lt;/P&gt;&lt;PRE&gt;mkdir /usr/hdp/current/hive-server2/auxlib&lt;/PRE&gt;&lt;P&gt;2- Copy your jar to the above folder in all hiveserver2 hosts.&lt;/P&gt;&lt;P&gt;3- Restart all hiveserver2 services&lt;/P&gt;&lt;P&gt;4- Create your UDF without 'using jar' clause (just once):&lt;/P&gt;&lt;PRE&gt;create function HVDB_Analysis_Archived.UDF_ForLogDatatoXML as 'UDF_ForLogDatatoXML'
&lt;/PRE&gt;</description>
    <pubDate>Tue, 22 Dec 2015 22:50:26 GMT</pubDate>
    <dc:creator>gbraccialli3</dc:creator>
    <dc:date>2015-12-22T22:50:26Z</dc:date>
    <item>
      <title>Error executing a hive UDF through jbdc</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100235#M13160</link>
      <description>&lt;P&gt;I have created a UDF and I added it to hive as a function as below&lt;/P&gt;&lt;P&gt;create function
HVDB_Analysis_Archived.UDF_ForLogDatatoXML as 'UDF_ForLogDatatoXML' &lt;/P&gt;&lt;P&gt;using jar
'hdfs://InnovationLab/tmp/UDF_ForLogDatatoXML.jar';&lt;/P&gt;&lt;P&gt;I am able to use this function through hive cli but through a java program using jbdc connection (with knox configuration), I am getting the below error.&lt;/P&gt;&lt;PRE&gt;Exception in thread "main" org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: SemanticException Line 0:-1 Invalid function 'HVDB_Analysis_Archived.UDF_ForLogDatatoXML'
        at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:255)
        at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:241)
        at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:247)
        at org.apache.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:378)
        at find_data_from_hive_uc3.main(find_data_from_hive_uc3.java:60)
Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: SemanticException Line 0:-1 Invalid function 'HVDB_XDLogFileAnalysis_Archived.UDF_ForLogDatatoXML'
        at org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:315)
        at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:112)
        at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:181)
        at org.apache.hive.service.cli.operation.Operation.run(Operation.java:257)
        at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(HiveSessionImpl.java:388)
        at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementAsync(HiveSessionImpl.java:375)
        at org.apache.hive.service.cli.CLIService.executeStatementAsync(CLIService.java:274)
        at org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(ThriftCLIService.java:486)
        at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1313)
        at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1298)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
        at org.apache.thrift.server.TServlet.doPost(TServlet.java:83)
        at org.apache.hive.service.cli.thrift.ThriftHttpServlet.doPost(ThriftHttpServlet.java:171)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
        at org.eclipse.jetty.server.Server.handle(Server.java:349)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:925)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:952)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Dec 2015 18:22:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100235#M13160</guid>
      <dc:creator>pooja_khandelwa</dc:creator>
      <dc:date>2015-12-21T18:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error executing a hive UDF through jbdc</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100236#M13161</link>
      <description>&lt;P&gt;When connecting remotely via JDBC the function library should be accessible to this environment. It's not the same as hive cli.&lt;/P&gt;&lt;P&gt;What tier are you getting this error in? Are you using hiveserver2? You would need to ensure those middle tiers have your custom jar as well.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 21:24:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100236#M13161</guid>
      <dc:creator>andrewg</dc:creator>
      <dc:date>2015-12-21T21:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error executing a hive UDF through jbdc</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100237#M13162</link>
      <description>&lt;P&gt;I have added the custom jar in my remote server too. Yes I am using hiveserver2. The code was working in HDP 2.1 but getting this issue after upgrade to 2.3&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 01:52:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100237#M13162</guid>
      <dc:creator>pooja_khandelwa</dc:creator>
      <dc:date>2015-12-22T01:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error executing a hive UDF through jbdc</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100238#M13163</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1499/poojakhandelwal.html" nodeid="1499"&gt;@pooja khandelwal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;1- Create directory below in all hiveserver2 hosts:&lt;/P&gt;&lt;PRE&gt;mkdir /usr/hdp/current/hive-server2/auxlib&lt;/PRE&gt;&lt;P&gt;2- Copy your jar to the above folder in all hiveserver2 hosts.&lt;/P&gt;&lt;P&gt;3- Restart all hiveserver2 services&lt;/P&gt;&lt;P&gt;4- Create your UDF without 'using jar' clause (just once):&lt;/P&gt;&lt;PRE&gt;create function HVDB_Analysis_Archived.UDF_ForLogDatatoXML as 'UDF_ForLogDatatoXML'
&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Dec 2015 22:50:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100238#M13163</guid>
      <dc:creator>gbraccialli3</dc:creator>
      <dc:date>2015-12-22T22:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error executing a hive UDF through jbdc</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100239#M13164</link>
      <description>&lt;P&gt;Make sure the jar file being referenced by the function has adequate permissions on hdfs. Is it the same user accessing this from hive cli and hiveserver2? Depending on hive.server2.enable.doAs setting your hiveserver2 user could be hive or the connecting user from JDBC.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2015 02:46:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100239#M13164</guid>
      <dc:creator>deepesh1</dc:creator>
      <dc:date>2015-12-23T02:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error executing a hive UDF through jbdc</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100240#M13165</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1499/poojakhandelwal.html" nodeid="1499"&gt;@pooja khandelwal&lt;/A&gt; has this been resolved? Can you accept the best answer or provide your own solution?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2016 10:33:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100240#M13165</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-02-03T10:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error executing a hive UDF through jbdc</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100241#M13166</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/1499/poojakhandelwal.html" nodeid="1499"&gt;@pooja khandelwal&lt;/A&gt;&lt;P&gt;I have tested this and this works. Accepting this as best answer. &lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 19:05:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-executing-a-hive-UDF-through-jbdc/m-p/100241#M13166</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2016-02-11T19:05:13Z</dc:date>
    </item>
  </channel>
</rss>

