You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by su...@apache.org on 2021/05/08 17:07:53 UTC
[hive] branch branch-3.1 updated: Improve Table#getEmptyTable
performance by disabling registerAllFunctionsOnce (#2251)
This is an automated email from the ASF dual-hosted git repository.
sunchao pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new b46b025 Improve Table#getEmptyTable performance by disabling registerAllFunctionsOnce (#2251)
b46b025 is described below
commit b46b02524cbcef92eca346ffa5a9e9bba83776e3
Author: Yuming Wang <yu...@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 ea200c8..4d2e1a4 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
@@ -347,6 +347,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 a3fde34..7a5866c 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
@@ -957,7 +957,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