private void initWrapper(QueryMetadataInterface acutalMetadata) { functionLibrary = acutalMetadata.getFunctionLibrary(); this.functions.addAll(Arrays.asList(this.functionLibrary.getUserFunctions())); metadata = new BasicQueryMetadataWrapper(acutalMetadata) { @Override public FunctionLibrary getFunctionLibrary() { return functionLibrary; } }; }
@Override protected NavigableMap<String, FunctionMethod> getChildren(Schema s, TransformationMetadata metadata) { //since there is no proper schema for a UDF model, no results will show up for legacy functions if (s.getName().equals(CoreConstants.SYSTEM_MODEL)) { //currently all system functions are contributed via alternative mechanisms //system source, push down functions. FunctionLibrary library = metadata.getFunctionLibrary(); FunctionTree tree = library.getSystemFunctions(); FunctionTree[] userFuncs = library.getUserFunctions(); TreeMap<String, FunctionMethod> functions = new TreeMap<String, FunctionMethod>(String.CASE_INSENSITIVE_ORDER); for (FunctionTree userFunc : userFuncs) { if (userFunc.getSchemaName().equals(CoreConstants.SYSTEM_MODEL)) { functions.putAll(userFunc.getFunctionsByUuid()); } } functions.putAll(tree.getFunctionsByUuid()); return functions; } return s.getFunctions(); } }
@Override protected NavigableMap<String, FunctionMethod> getChildren(Schema s, TransformationMetadata metadata) { //since there is no proper schema for a UDF model, no results will show up for legacy functions if (s.getName().equals(CoreConstants.SYSTEM_MODEL)) { //currently all system functions are contributed via alternative mechanisms //system source, push down functions. FunctionLibrary library = metadata.getFunctionLibrary(); FunctionTree tree = library.getSystemFunctions(); FunctionTree[] userFuncs = library.getUserFunctions(); TreeMap<String, FunctionMethod> functions = new TreeMap<String, FunctionMethod>(String.CASE_INSENSITIVE_ORDER); for (FunctionTree userFunc : userFuncs) { if (userFunc.getSchemaName().equals(CoreConstants.SYSTEM_MODEL)) { functions.putAll(userFunc.getFunctionsByUuid()); } } functions.putAll(tree.getFunctionsByUuid()); return functions; } return s.getFunctions(); } }
@Override protected NavigableMap<String, FunctionMethod> getChildren(Schema s, TransformationMetadata metadata) { //since there is no proper schema for a UDF model, no results will show up for legacy functions if (s.getName().equals(CoreConstants.SYSTEM_MODEL)) { //currently all system functions are contributed via alternative mechanisms //system source, push down functions. FunctionLibrary library = metadata.getFunctionLibrary(); FunctionTree tree = library.getSystemFunctions(); FunctionTree[] userFuncs = library.getUserFunctions(); TreeMap<String, FunctionMethod> functions = new TreeMap<String, FunctionMethod>(String.CASE_INSENSITIVE_ORDER); for (FunctionTree userFunc : userFuncs) { if (userFunc.getSchemaName().equals(CoreConstants.SYSTEM_MODEL)) { functions.putAll(userFunc.getFunctionsByUuid()); } } functions.putAll(tree.getFunctionsByUuid()); return functions; } return s.getFunctions(); } }