saihemanth-cloudera commented on code in PR #5275: URL: https://github.com/apache/hive/pull/5275#discussion_r1725665985
########## standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java: ########## @@ -11878,6 +11878,45 @@ public List<String> getFunctions(String catName, String dbName, String pattern) return funcs; } + @Override + public <T> List<T> getFunctionsRequest(String catName, String dbName, String pattern, + boolean isReturnNames) throws MetaException { + boolean commited = false; + Query query = null; + try { + openTransaction(); + dbName = normalizeIdentifier(dbName); + // Take the pattern and split it on the | to get all the composing + // patterns + List<String> parameterVals = new ArrayList<>(); + StringBuilder filterBuilder = new StringBuilder(); + appendSimpleCondition(filterBuilder, "database.name", new String[] { dbName }, parameterVals); + appendSimpleCondition(filterBuilder, "database.catalogName", new String[] {catName}, parameterVals); + if(pattern != null) { + appendPatternCondition(filterBuilder, "functionName", pattern, parameterVals); + } + query = pm.newQuery(MFunction.class, filterBuilder.toString()); + if (isReturnNames) { + query.setResult("functionName"); + } + query.setOrdering("functionName ascending"); + List<MFunction> functionList = (List<MFunction>) query.executeWithArray(parameterVals.toArray(new String[0])); Review Comment: Ack -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org