Hi,
I know I have asked this question before but the answers didn't quite satisfy 
my requirements. Our problem stems from the fact that there is not built-in UDF 
equivalent to yearweek of Mysql. This gives the year + week concatenated, with 
the week starting on Sunday.
So we wrote our UDF but now we want it to be available to everyone in the 
company regardless of how they are using Hive, through web client of CLi. I 
want to install this jar in a place where it gets added to the Hive classpath 
(This part is not hard). Whats hard is simulating 
"create temporary function yearweek as 'classname'" 

I want the ability to have this registered permanently. I traced it down to 
FunctionRegistry class where the build-ins are registered at init time and 
there is a statis public method available
public static void registerUDF(boolean isNative, String functionName,
      Class<? extends UDF> UDFClass, boolean isOperator) {
    registerUDF(isNative, functionName, UDFClass, isOperator, functionName
        .toLowerCase());
  }

which I just want to trigger like FunctionRegistry.registerUDF(true, 
"yearweek", myclass, false)
Is there any switch/setting anywhere I can trigger this ? 
I need this the most for the Hive server.
Short of patching the code, I can't seem to find a way.

Ideally there would be a version like: 
create [permanent] function yearweek as 'classname'
 
-Ayon
See My Photos on Flickr
Also check out my Blog for answers to commonly asked questions.

Reply via email to