The using statement support multiple resources,so you can create function with “using jar HDFS://path/to/A.jar, jar HDFS://path/to/B.jar,…”
发件人: Buntu Dev [mailto:[email protected]] 发送时间: 2015年4月24日 15:18 收件人: [email protected] 主题: Re: Create function using custom UDF Thanks Loudongfeng for pointing that out, that has worked after providing the JAR HDFS path. If there are any JARs that this UDF depends on then 'add jar <dependent jar>' still seem to be needed or updating the hive-site.xml is another option. On Thu, Apr 23, 2015 at 11:43 PM, Loudongfeng <[email protected]<mailto:[email protected]>> wrote: Referring to https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Create/DropFunction You don’t need to add jar every time when using Permanent Functions. Make sure to create your function following this CREATE FUNCTION [db_name.]function_name AS class_name [USING JAR|FILE|ARCHIVE 'file_uri' [, JAR|FILE|ARCHIVE 'file_uri'] ]; 发件人: Buntu Dev [mailto:[email protected]<mailto:[email protected]>] 发送时间: 2015年4月24日 12:20 收件人: [email protected]<mailto:[email protected]> 主题: Re: Create function using custom UDF Thanks again for the info! On Thu, Apr 23, 2015 at 8:30 PM, sadhana yr <[email protected]<mailto:[email protected]>> wrote: For global configuration add the statements to $HIVE_HOME/bin/.hiverc. One other alternative, Add following property to your hive-site.xml <property> <name>hive.aux.jars.path</name> <value>file:///home/me/my.jar,file:///home/you/your.jar,file:///home/us/our.jar</value<file:///\\home\me\my.jar,file:\home\you\your.jar,file:\home\us\our.jar%3c\value>> </property> On Thu, Apr 23, 2015 at 11:13 PM, Buntu Dev <[email protected]<mailto:[email protected]>> wrote: Thanks but is there a way to make it available to other users and avoid 'add jar <jar>' step? On Thu, Apr 23, 2015 at 7:50 PM, Sadhana <[email protected]<mailto:[email protected]>> wrote: Yes, functions declared will only be available in the current session. You will have to add the JAR to the class path and create the function in each session. If you use the same Jar files and functions frequently, you can add those statements to your $HOME/.hiverc file. > On Apr 23, 2015, at 10:37 PM, Buntu Dev > <[email protected]<mailto:[email protected]>> wrote: > > Does the JAR need to be added for every session before using the custom UDF > created using "CREATE FUNCTION"? > > I'm using Hive 0.13 and was able to add a custom UDF successfully and use it > in a sample query. But in the subsequent Hive sessions, I do see the function > but I get this error when using the function: > > FAILED: SemanticException [Error 10011]: Line 1:7 Invalid function 'my_func' > > Thanks for the help! -- Sadhana [email protected]<mailto:[email protected]> 408-837-2419<tel:408-837-2419>
