use of org.apache.hadoop.hive.ql.udf.generic.GenericUDFCurrentTimestamp in project hive by apache.
the class TestFunctionRegistry method testIsPermanentFunction.
public void testIsPermanentFunction() throws Exception {
// Setup exprNode
GenericUDF udf = new GenericUDFCurrentTimestamp();
List<ExprNodeDesc> children = new ArrayList<ExprNodeDesc>();
ExprNodeGenericFuncDesc fnExpr = new ExprNodeGenericFuncDesc(TypeInfoFactory.timestampTypeInfo, udf, children);
assertFalse("Function not added as permanent yet", FunctionRegistry.isPermanentFunction(fnExpr));
// Now register as permanent function
FunctionResource[] emptyResources = new FunctionResource[] {};
FunctionRegistry.registerPermanentFunction("default.perm_current_timestamp", GenericUDFCurrentTimestamp.class.getName(), true, emptyResources);
assertTrue("Function should now be recognized as permanent function", FunctionRegistry.isPermanentFunction(fnExpr));
}
Aggregations