This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new e31bef1 Revert "[SPARK-35321][SQL] Don't register Hive permanent functions when creating Hive client" e31bef1 is described below commit e31bef1ed4744de9e83bac1887cbfaad7597d78f Author: Dongjoon Hyun <dongj...@apache.org> AuthorDate: Sat May 8 13:01:17 2021 -0700 Revert "[SPARK-35321][SQL] Don't register Hive permanent functions when creating Hive client" This reverts commit b4ec9e230484db88c6220c27e43e3db11f3bdeef. --- .../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 9bb3f45..e9728b8 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 @@ -273,7 +273,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 } @@ -303,7 +303,7 @@ private[hive] class HiveClientImpl( // with the side-effect of Hive.get(conf) to avoid using out-of-date HiveConf. // See discussion in https://github.com/apache/spark/pull/16826/files#r104606859 // for more details. - 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 b0a877d..2f7fe96 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], @@ -1320,13 +1316,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