InCDH 5.12 / Impala 2.9and higher, you can refresh the user-defined functions (UDFs) that Impala recognizes, at the database level, by running theREFRESH FUNCTIONSstatement with the database name as an argument. Java-based UDFs can be added to the metastore database through HiveCREATE FUNCTIONstatements, and made visible to Impala by subsequently runningREFRESH FUNCTIONS. For example:
CREATE DATABASE shared_udfs;
...use CREATE FUNCTION statements in Hive to create some Java-based UDFs
that Impala is not initially aware of...
REFRESH FUNCTIONS shared_udfs;
SELECT udf_created_by_hive(c1) FROM ...
And in 2.X version of impala the only way is to grant all on server to the role, while in Impala 3.0 and higher the minimum level of privileges required by refresh functions is to grant refresh on database to the role.