@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(); } }
function.setName(function.getName().substring(SYS_PREFIX.length())); } else if (library.getSystemFunctions().hasFunctionWithName(function.getName()) && !StringUtil.startsWithIgnoreCase(function.getName(), function.getFunctionDescriptor().getSchema() + ElementSymbol.SEPARATOR)) { function.setName(function.getFunctionDescriptor().getSchema() + ElementSymbol.SEPARATOR + function.getName());
function.setName(function.getName().substring(SYS_PREFIX.length())); } else if (library.getSystemFunctions().hasFunctionWithName(function.getName()) && !StringUtil.startsWithIgnoreCase(function.getName(), function.getFunctionDescriptor().getSchema() + ElementSymbol.SEPARATOR)) { function.setName(function.getFunctionDescriptor().getSchema() + ElementSymbol.SEPARATOR + function.getName());
function.setName(function.getName().substring(SYS_PREFIX.length())); } else if (library.getSystemFunctions().hasFunctionWithName(function.getName()) && !StringUtil.startsWithIgnoreCase(function.getName(), function.getFunctionDescriptor().getSchema() + ElementSymbol.SEPARATOR)) { function.setName(function.getFunctionDescriptor().getSchema() + ElementSymbol.SEPARATOR + function.getName());