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/07 05:34:17 UTC
[hive] branch branch-2.3 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-2.3
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/branch-2.3 by this push:
new b358f65 Improve Table#getEmptyTable performance by disabling registerAllFunctionsOnce (#2251)
b358f65 is described below
commit b358f650479fa1e4f1f273a6a8ca38f3e77fc5ef
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 f64cfda..cc5712d 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
@@ -304,6 +304,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 33f01d6..8efc531 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
@@ -914,7 +914,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