hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sunc...@apache.org
Subject [hive] branch branch-3 updated: Improve Table#getEmptyTable performance by disabling registerAllFunctionsOnce (#2251)
Date Sat, 08 May 2021 17:08:14 GMT
This is an automated email from the ASF dual-hosted git repository.

sunchao pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/branch-3 by this push:
     new fd870ef  Improve Table#getEmptyTable performance by disabling registerAllFunctionsOnce
(#2251)
fd870ef is described below

commit fd870ef84926f4090ff4da57e1439e195fb24b9d
Author: Yuming Wang <yumwang@ebay.com>
AuthorDate: Fri May 7 13:31:46 2021 +0800

    Improve Table#getEmptyTable performance by disabling registerAllFunctionsOnce (#2251)
---
 ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java        | 7 +++++++
 ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
index 08d257d..6ca82a6 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
@@ -350,6 +350,13 @@ public class Hive {
     return getInternal(c, false, true, doRegisterAllFns);
   }
 
+  /**
+   * Same as {@link #get(HiveConf)}, except that it does not register all functions.
+   */
+  public static Hive getWithoutRegisterFns(HiveConf c) throws HiveException {
+    return getInternal(c, false, false, false);
+  }
+
   private static Hive getInternal(HiveConf c, boolean needsRefresh, boolean isFastCheck,
       boolean doRegisterAllFns) throws HiveException {
     Hive db = hiveDB.get();
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java b/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
index 8e6554c..56c32e8 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
@@ -961,7 +961,7 @@ public class SessionState {
     authorizerV2.applyAuthorizationConfigPolicy(sessionConf);
     // update config in Hive thread local as well and init the metastore client
     try {
-      Hive.get(sessionConf).getMSC();
+      Hive.getWithoutRegisterFns(sessionConf).getMSC();
     } catch (Exception e) {
       // catch-all due to some exec time dependencies on session state
       // that would cause ClassNoFoundException otherwise

Mime
View raw message