saihemanth-cloudera commented on code in PR #5275:
URL: https://github.com/apache/hive/pull/5275#discussion_r1723641446


##########
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:
   Yeah, we fetch Mfunction in case of function names: 
https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L11866-L11868
 and get function name from it.



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -8884,6 +8884,30 @@ public List<String> get_functions(String dbName, String 
pattern)
     return funcNames;
   }
 
+  @Override
+  public GetFunctionsResponse get_functions_req(GetFunctionsRequest req)
+      throws MetaException {
+    startFunction("get_functions", ": db=" + req.getDbName()

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

Reply via email to