Hi all,

We have a few Hive UDFs where I work.  These are deployed by a bootstrap
script so that the JAR files are in Hive's CLASSPATH before the server
starts.

This works to load the UDF whenever a cluster is started and then the UDF
can be loaded with the ADD JAR and CREATE TEMPORARY FUNCTION commands.
However, if I copy out a UDF after Hive has been running, the new UDF does
not get loaded.  In order to load a new UDF, the only thing I have found
that works is to restart the cluster.

i.e., I have currently: MyLibrary-1.1.2-SNAPSHOT.jar

which can be used with:

ADD JAR /home/hadoop/lib/MyLibrary-1.1.2-SNAPSHOT.jar
CREATE TEMPORARY FUNCTION my_function as 'com.namespace.ClassName'
select my_function( args ) ...

After I copy out a new jar with a new version I load it as:

ADD JAR /home/hadoop/lib/MyLibrary-1.1.3-SNAPSHOT.jar
CREATE TEMPORARY FUNCTION my_function as 'com.namespace.ClassName'

Finally when calling the function
select my_function( args ) ...

It appears that there is no change in the function behavior.  It still is
using the old version 1.1.2, so I believe it is cached.

Has anyone else seen this?  and is there any standard way to deploy a UDF
in order to ensure the new function is being used in Hive?

Thanks,
Dave

Reply via email to