@Test public void testNullDependent() { FunctionDescriptor actual = library.findFunction("concat2", new Class<?>[] {String.class, String.class}); assertTrue(actual.isNullDependent()); actual = library.findFunction("concat", new Class<?>[] {String.class, String.class}); assertFalse(actual.isNullDependent()); }
public FunctionDescriptor findFunction(String name, Class<?>[] types) { FunctionDescriptor descriptor = systemFunctions.getFunction(name, types); if(descriptor == null && this.userFunctions != null) { for (FunctionTree tree: this.userFunctions) { descriptor = tree.getFunction(name, types); if (descriptor != null) { break; } } } return descriptor; }
FunctionLibrary { public FunctionDescriptor findFunction(String name, Class<?>[] types) { FunctionDescriptor descriptor = systemFunctions.getFunction(name, types); if(descriptor == null && this.userFunctions != null) { for (FunctionTree tree: this.userFunctions) { descriptor = tree.getFunction(name, types); if (descriptor != null) { break; } } } return descriptor; } }
FunctionLibrary { public FunctionDescriptor findFunction(String name, Class<?>[] types) { FunctionDescriptor descriptor = systemFunctions.getFunction(name, types); if(descriptor == null && this.userFunctions != null) { for (FunctionTree tree: this.userFunctions) { descriptor = tree.getFunction(name, types); if (descriptor != null) { break; } } } return descriptor; } FunctionLibrary(FunctionTree systemFuncs, FunctionTree... userFuncs); }
FunctionLibrary { public FunctionDescriptor findFunction(String name, Class<?>[] types) { FunctionDescriptor descriptor = systemFunctions.getFunction(name, types); if(descriptor == null && this.userFunctions != null) { for (FunctionTree tree: this.userFunctions) { descriptor = tree.getFunction(name, types); if (descriptor != null) { break; } } } return descriptor; } FunctionLibrary(FunctionTree systemFuncs, FunctionTree... userFuncs); FunctionTree[] getUserFunctions(); FunctionTree getSystemFunctions(); List<String> getFunctionCategories(); List<FunctionMethod> getFunctionsInCategory(String category); boolean hasFunctionMethod(String name, int numArgs); FunctionDescriptor findFunction(String name, Class<?>[] types); List<FunctionDescriptor> findAllFunctions(String name, Class<?>[] types); ConversionResult determineNecessaryConversions(String name, Class<?> returnType, Expression[] args, Class<?>[] types, boolean hasUnknownType); FunctionDescriptor[] getConverts(FunctionMethod method, Class<?>[] types); boolean isVarArgArrayParam(FunctionMethod method, Class<?>[] types,
            int i, Class<?> targetType); FunctionDescriptor findTypedConversionFunction(Class<?> sourceType, Class<?> targetType); FunctionDescriptor copyFunctionChangeReturnType(FunctionDescriptor fd, Class<?> returnType); static boolean isConvert(Function function); List<FunctionMethod> getBuiltInAggregateFunctions(boolean includeAnalytic); boolean userFunctionExists(String resourceName); }
FunctionLibrary { public FunctionDescriptor findFunction(String name, Class<?>[] types) { FunctionDescriptor descriptor = systemFunctions.getFunction(name, types); if(descriptor == null && this.userFunctions != null) { for (FunctionTree tree: this.userFunctions) { descriptor = tree.getFunction(name, types); if (descriptor != null) { break; } } } return descriptor; } FunctionLibrary(FunctionTree systemFuncs, FunctionTree... userFuncs); FunctionTree[] getUserFunctions(); FunctionTree getSystemFunctions(); List<String> getFunctionCategories(); List<FunctionMethod> getFunctionsInCategory(String category); boolean hasFunctionMethod(String name, int numArgs); FunctionDescriptor findFunction(String name, Class<?>[] types); List<FunctionDescriptor> findAllFunctions(String name, Class<?>[] types); ConversionResult determineNecessaryConversions(String name, Class<?> returnType, Expression[] args, Class<?>[] types, boolean hasUnknownType); FunctionDescriptor[] getConverts(FunctionMethod method, Class<?>[] types); boolean isVarArgArrayParam(FunctionMethod method, Class<?>[] types,
            int i, Class<?> targetType); FunctionDescriptor findTypedConversionFunction(Class<?> sourceType, Class<?> targetType); FunctionDescriptor copyFunctionChangeReturnType(FunctionDescriptor fd, Class<?> returnType); static boolean isConvert(Function function); List<FunctionMethod> getBuiltInAggregateFunctions(boolean includeAnalytic); boolean userFunctionExists(String resourceName); static final String CONVERT; static final String CAST; static final String LOOKUP; static final String USER; static final String ENV; static final String SYS_PROP; static final String ENV_VAR; static final String SESSION_ID; static final String DECODESTRING; static final String DECODEINTEGER; static final String COMMAND_PAYLOAD; static final String CONCAT; static final String CONCAT2; static final String CONCAT_OPERATOR; static final String SUBSTRING; static final String NVL; static final String IFNULL; static final String FROM_UNIXTIME; static final String TIMESTAMPADD; static final String PARSETIME; static final String PARSEDATE; static final String FORMATTIME; static final String FORMATDATE; static final String NULLIF; static final String COALESCE; static final String SPACE; static final String ARRAY_GET; static final String JSONARRAY; static final String MVSTATUS; static final Set<String> INTERNAL_SCHEMAS; }