Skip to content

Commit caa17cf

Browse files
committed
fix
1 parent dd9fbf4 commit caa17cf

File tree

1 file changed

+8
-6
lines changed
  • standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore

1 file changed

+8
-6
lines changed

standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8788,20 +8788,22 @@ public GetFunctionsResponse get_functions_req(GetFunctionsRequest req)
87888788

87898789
RawStore ms = getMS();
87908790
Exception ex = null;
8791-
List<Function> funcs = null;
8791+
GetFunctionsResponse response = new GetFunctionsResponse();
87928792
String catName = req.isSetCatalogName() ? req.getCatalogName() : getDefaultCatalog(conf);
87938793
try {
8794-
funcs = ms.getFunctionsRequest(catName, req.getDbName(),
8794+
List result = ms.getFunctionsRequest(catName, req.getDbName(),
87958795
req.getPattern(), req.isReturnNames());
8796+
if (req.isReturnNames()) {
8797+
response.setFunction_names(result);
8798+
} else {
8799+
response.setFunctions(result);
8800+
}
87968801
} catch (Exception e) {
87978802
ex = e;
87988803
throw newMetaException(e);
87998804
} finally {
8800-
endFunction("get_functions", funcs != null, ex);
8805+
endFunction("get_functions", ex != null, ex);
88018806
}
8802-
GetFunctionsResponse response = new GetFunctionsResponse();
8803-
response.setFunctions(funcs);
8804-
88058807
return response;
88068808
}
88078809

0 commit comments

Comments
 (0)