Every time we want to use the function, we need to add the jar and create a temporary function
hive> ADD JAR /home/cloudera/mask.jar;
Added [/home/cloudera/mask.jar] to class path
Added resources: [/home/cloudera/mask.jar]
hive> CREATE TEMPORARY FUNCTION MASK AS 'hiveudf.PImask';
hive> ADD JAR /home/cloudera/mask.jar; Added [/home/cloudera/mask.jar] to class path Added resources: [/home/cloudera/mask.jar] hive> CREATE TEMPORARY FUNCTION MASK AS 'hiveudf.PImask';
HIVE PERMANENT FUNCTION
Note: If we have already created a temporary file then we need to create a new function name while creating permanent function
The problem with temporary function is that the function is valid only till
the session is alive in which it was created and is lost as soon as we
log off.
Many a times we have requirements where we need the functions to be
permanent so that they can be used across sessions and across different
edge nodes. Let us create a permanent function from the same jar file
and test the same.