This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch branch-3.1 in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.1 by this push: new 53a93fc Revert "[SPARK-35321][SQL][3.1] Don't register Hive permanent functions when creating Hive client" 53a93fc is described below commit 53a93fc04402f0ff7eb64371d869c8f1bb177c25 Author: Dongjoon Hyun <dongj...@apache.org> AuthorDate: Sat May 8 13:01:45 2021 -0700 Revert "[SPARK-35321][SQL][3.1] Don't register Hive permanent functions when creating Hive client" This reverts commit 6fbea6a38ddd0c95d54a71c850e0d901727ed842. --- .../org/apache/spark/sql/hive/client/HiveClientImpl.scala | 4 ++-- .../scala/org/apache/spark/sql/hive/client/HiveShim.scala | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala index e9ab3af..0d45af2 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala @@ -254,7 +254,7 @@ private[hive] class HiveClientImpl( if (clientLoader.cachedHive != null) { clientLoader.cachedHive.asInstanceOf[Hive] } else { - val c = shim.getHive(conf) + val c = Hive.get(conf) clientLoader.cachedHive = c c } @@ -282,7 +282,7 @@ private[hive] class HiveClientImpl( // Set the thread local metastore client to the client associated with this HiveClientImpl. Hive.set(client) // Replace conf in the thread local Hive with current conf - shim.getHive(conf) + Hive.get(conf) // setCurrentSessionState will use the classLoader associated // with the HiveConf in `state` to override the context class loader of the current // thread. diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala index 8d0f3e8..db67480 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala @@ -177,8 +177,6 @@ private[client] sealed abstract class Shim { def getMSC(hive: Hive): IMetaStoreClient - def getHive(hiveConf: HiveConf): Hive - protected def findMethod(klass: Class[_], name: String, args: Class[_]*): Method = { klass.getMethod(name, args: _*) } @@ -201,8 +199,6 @@ private[client] class Shim_v0_12 extends Shim with Logging { getMSCMethod.invoke(hive).asInstanceOf[IMetaStoreClient] } - override def getHive(hiveConf: HiveConf): Hive = Hive.get(hiveConf) - private lazy val startMethod = findStaticMethod( classOf[SessionState], @@ -1293,13 +1289,6 @@ private[client] class Shim_v2_1 extends Shim_v2_0 { override def alterPartitions(hive: Hive, tableName: String, newParts: JList[Partition]): Unit = { alterPartitionsMethod.invoke(hive, tableName, newParts, environmentContextInAlterTable) } - - // HIVE-10319 introduced a new HMS thrift API `get_all_functions` which is used by - // `Hive.get` since version 2.1.0, when it loads all Hive permanent functions during - // initialization. This breaks compatibility with HMS server of lower versions. - // To mitigate here we use `Hive.getWithFastCheck` instead which skips loading the permanent - // functions and therefore avoids calling `get_all_functions`. - override def getHive(hiveConf: HiveConf): Hive = Hive.getWithFastCheck(hiveConf, false) } private[client] class Shim_v2_2 extends Shim_v2_1 --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org