Restart HiveServer2 after the JAR file is updated.
Note: This option is unfavorable in development systems where constant updates and testing is required.
Use versioning of UDF JAR files.
A JAR file with name udf-classes.jar, can be renamed to:
So when a new version is released, simply drop the function, re-create it using the new JAR, and the new function will be ready to be used.
-- initially created function "test"
CREATE FUNCTION test AS 'package_name' USING JAR '/uri/udf-classes-1.0.jar';
-- after new jar is in place, update the "test" function
DROP FUNCTION test;
CREATE FUNCTION test AS 'package_name' USING JAR '/uri/udf-classes-2.0.jar';