This is an automated email from the ASF dual-hosted git repository.
ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new bd16e009891 HIVE-27780: Implement direct SQL for get_all_functions -
ADDENDUM (#4971). (zhangbutao, reviewed by Ayush Saxena)
bd16e009891 is described below
commit bd16e0098916aa5fc2dede99492c6a240b51e677
Author: Butao Zhang <[email protected]>
AuthorDate: Tue Dec 26 16:07:14 2023 +0800
HIVE-27780: Implement direct SQL for get_all_functions - ADDENDUM (#4971).
(zhangbutao, reviewed by Ayush Saxena)
---
.../main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
index d5e0db5366c..18bffce36f7 100644
---
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
+++
b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
@@ -3143,6 +3143,9 @@ class MetaStoreDirectSql {
public List<Function> getFunctions(String catName) throws MetaException {
List<Long> funcIds = getFunctionIds(catName);
+ if (funcIds.isEmpty()) {
+ return Collections.emptyList(); // no functions, bail early.
+ }
// Get full objects. For Oracle/etc. do it in batches.
return Batchable.runBatched(batchSize, funcIds, new Batchable<Long,
Function>() {
@Override