private FunctionInfo registerTableFunction(String functionName, FunctionType functionType, Class<? extends TableFunctionResolver> tFnCls, FunctionResource... resources) { validateClass(tFnCls, TableFunctionResolver.class); FunctionInfo function = new FunctionInfo(functionType, functionName, tFnCls, resources); addFunction(functionName, function); return function; }
public FunctionInfo registerMacro(String macroName, ExprNodeDesc body, List<String> colNames, List<TypeInfo> colTypes, FunctionResource... resources) { GenericUDFMacro macro = new GenericUDFMacro(macroName, body, colNames, colTypes); FunctionInfo fI = new FunctionInfo(FunctionType.TEMPORARY, macroName, macro, resources); addFunction(macroName, fI); return fI; }
private FunctionInfo registerTableFunction(String functionName, FunctionType functionType, Class<? extends TableFunctionResolver> tFnCls, FunctionResource... resources) { validateClass(tFnCls, TableFunctionResolver.class); FunctionInfo function = new FunctionInfo(functionType, functionName, tFnCls, resources); addFunction(functionName, function); return function; }
public FunctionInfo registerMacro(String macroName, ExprNodeDesc body, List<String> colNames, List<TypeInfo> colTypes, FunctionResource... resources) { GenericUDFMacro macro = new GenericUDFMacro(macroName, body, colNames, colTypes); FunctionInfo fI = new FunctionInfo(FunctionType.TEMPORARY, macroName, macro, resources); addFunction(macroName, fI); return fI; }
private FunctionInfo registerUDF(String functionName, FunctionType functionType, Class<? extends UDF> UDFClass, boolean isOperator, String displayName, FunctionResource... resources) { validateClass(UDFClass, UDF.class); FunctionInfo fI = new FunctionInfo(functionType, displayName, new GenericUDFBridge(displayName, isOperator, UDFClass.getName()), resources); addFunction(functionName, fI); return fI; }
private FunctionInfo registerGenericUDF(String functionName, FunctionType functionType, Class<? extends GenericUDF> genericUDFClass, FunctionResource... resources) { validateClass(genericUDFClass, GenericUDF.class); FunctionInfo fI = new FunctionInfo(functionType, functionName, ReflectionUtil.newInstance(genericUDFClass, null), resources); addFunction(functionName, fI); return fI; }
private FunctionInfo registerGenericUDTF(String functionName, FunctionType functionType, Class<? extends GenericUDTF> genericUDTFClass, FunctionResource... resources) { validateClass(genericUDTFClass, GenericUDTF.class); FunctionInfo fI = new FunctionInfo(functionType, functionName, ReflectionUtil.newInstance(genericUDTFClass, null), resources); addFunction(functionName, fI); return fI; }
private FunctionInfo registerUDF(String functionName, FunctionType functionType, Class<? extends UDF> UDFClass, boolean isOperator, String displayName, FunctionResource... resources) { validateClass(UDFClass, UDF.class); FunctionInfo fI = new FunctionInfo(functionType, displayName, new GenericUDFBridge(displayName, isOperator, UDFClass.getName()), resources); addFunction(functionName, fI); return fI; }
private FunctionInfo registerGenericUDF(String functionName, FunctionType functionType, Class<? extends GenericUDF> genericUDFClass, FunctionResource... resources) { validateClass(genericUDFClass, GenericUDF.class); FunctionInfo fI = new FunctionInfo(functionType, functionName, ReflectionUtil.newInstance(genericUDFClass, null), resources); addFunction(functionName, fI); return fI; }
private FunctionInfo registerGenericUDTF(String functionName, FunctionType functionType, Class<? extends GenericUDTF> genericUDTFClass, FunctionResource... resources) { validateClass(genericUDTFClass, GenericUDTF.class); FunctionInfo fI = new FunctionInfo(functionType, functionName, ReflectionUtil.newInstance(genericUDTFClass, null), resources); addFunction(functionName, fI); return fI; }
private static FunctionInfo handleCastForParameterizedType(TypeInfo ti, FunctionInfo fi) { SettableUDF udf = (SettableUDF) fi.getGenericUDF(); try { udf.setTypeInfo(ti); } catch (UDFArgumentException e) { throw new RuntimeException(e); } return new FunctionInfo( fi.getFunctionType(), fi.getDisplayName(), (GenericUDF) udf, fi.getResources()); }
private static FunctionInfo handleCastForParameterizedType(TypeInfo ti, FunctionInfo fi) { SettableUDF udf = (SettableUDF) fi.getGenericUDF(); try { udf.setTypeInfo(ti); } catch (UDFArgumentException e) { throw new RuntimeException(e); } return new FunctionInfo( fi.getFunctionType(), fi.getDisplayName(), (GenericUDF) udf, fi.getResources()); }
public FunctionInfo registerPermanentFunction(String functionName, String className, boolean registerToSession, FunctionResource... resources) throws SemanticException { FunctionInfo function = new FunctionInfo(functionName, className, resources); // register to session first for backward compatibility if (registerToSession) { String qualifiedName = FunctionUtils.qualifyFunctionName( functionName, SessionState.get().getCurrentDatabase().toLowerCase()); if (registerToSessionRegistry(qualifiedName, function) != null) { addFunction(functionName, function); return function; } } else { addFunction(functionName, function); } return null; }
public FunctionInfo registerPermanentFunction(String functionName, String className, boolean registerToSession, FunctionResource... resources) { FunctionInfo function = new FunctionInfo(functionName, className, resources); // register to session first for backward compatibility if (registerToSession) { String qualifiedName = FunctionUtils.qualifyFunctionName( functionName, SessionState.get().getCurrentDatabase().toLowerCase()); if (registerToSessionRegistry(qualifiedName, function) != null) { addFunction(functionName, function); return function; } } else { addFunction(functionName, function); } return null; }
public static void registerGenericUDF(boolean isNative, String functionName, Class<? extends GenericUDF> genericUDFClass) { if (GenericUDF.class.isAssignableFrom(genericUDFClass)) { FunctionInfo fI = new FunctionInfo(isNative, functionName, (GenericUDF) ReflectionUtils.newInstance(genericUDFClass, null)); mFunctions.put(functionName.toLowerCase(), fI); } else { throw new RuntimeException("Registering GenericUDF Class " + genericUDFClass + " which does not extend " + GenericUDF.class); } }
public FunctionInfo registerGenericUDF(String functionName, Class<? extends GenericUDF> genericUDFClass, FunctionResource... resources) { validateClass(genericUDFClass, GenericUDF.class); FunctionInfo fI = new FunctionInfo(isNative, functionName, ReflectionUtils.newInstance(genericUDFClass, null), resources); addFunction(functionName, fI); return fI; }
public FunctionInfo registerMacro(String macroName, ExprNodeDesc body, List<String> colNames, List<TypeInfo> colTypes, FunctionResource... resources) { GenericUDFMacro macro = new GenericUDFMacro(macroName, body, colNames, colTypes); FunctionInfo fI = new FunctionInfo(isNative, macroName, macro, resources); addFunction(macroName, fI); return fI; }
public FunctionInfo registerTableFunction(String functionName, Class<? extends TableFunctionResolver> tFnCls, FunctionResource... resources) { validateClass(tFnCls, TableFunctionResolver.class); FunctionInfo function = new FunctionInfo(isNative, functionName, tFnCls, resources); addFunction(functionName, function); return function; }
public FunctionInfo registerUDF(String functionName, Class<? extends UDF> UDFClass, boolean isOperator, String displayName, FunctionResource... resources) { validateClass(UDFClass, UDF.class); FunctionInfo fI = new FunctionInfo(isNative, displayName, new GenericUDFBridge(displayName, isOperator, UDFClass.getName()), resources); addFunction(functionName, fI); return fI; }
private static FunctionInfo handleCastForParameterizedType(TypeInfo ti, FunctionInfo fi) { SettableUDF udf = (SettableUDF) fi.getGenericUDF(); try { udf.setTypeInfo(ti); } catch (UDFArgumentException e) { throw new RuntimeException(e); } return new FunctionInfo( fi.isNative(), fi.getDisplayName(), (GenericUDF) udf, fi.getResources()); }