Skip to content

Commit 2831c62

Browse files
committed
Revert "[SPARK-35321][SQL][3.0] Don't register Hive permanent functions when creating Hive client"
This reverts commit 5268a38.
1 parent 5268a38 commit 2831c62

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private[hive] class HiveClientImpl(
258258
if (clientLoader.cachedHive != null) {
259259
clientLoader.cachedHive.asInstanceOf[Hive]
260260
} else {
261-
val c = shim.getHive(conf)
261+
val c = Hive.get(conf)
262262
clientLoader.cachedHive = c
263263
c
264264
}
@@ -286,7 +286,7 @@ private[hive] class HiveClientImpl(
286286
// Set the thread local metastore client to the client associated with this HiveClientImpl.
287287
Hive.set(client)
288288
// Replace conf in the thread local Hive with current conf
289-
shim.getHive(conf)
289+
Hive.get(conf)
290290
// setCurrentSessionState will use the classLoader associated
291291
// with the HiveConf in `state` to override the context class loader of the current
292292
// thread.

sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ private[client] sealed abstract class Shim {
173173

174174
def getMSC(hive: Hive): IMetaStoreClient
175175

176-
def getHive(hiveConf: HiveConf): Hive
177-
178176
protected def findMethod(klass: Class[_], name: String, args: Class[_]*): Method = {
179177
klass.getMethod(name, args: _*)
180178
}
@@ -197,8 +195,6 @@ private[client] class Shim_v0_12 extends Shim with Logging {
197195
getMSCMethod.invoke(hive).asInstanceOf[IMetaStoreClient]
198196
}
199197

200-
override def getHive(hiveConf: HiveConf): Hive = Hive.get(hiveConf)
201-
202198
private lazy val startMethod =
203199
findStaticMethod(
204200
classOf[SessionState],
@@ -1237,13 +1233,6 @@ private[client] class Shim_v2_1 extends Shim_v2_0 {
12371233
override def alterPartitions(hive: Hive, tableName: String, newParts: JList[Partition]): Unit = {
12381234
alterPartitionsMethod.invoke(hive, tableName, newParts, environmentContextInAlterTable)
12391235
}
1240-
1241-
// HIVE-10319 introduced a new HMS thrift API `get_all_functions` which is used by
1242-
// `Hive.get` since version 2.1.0, when it loads all Hive permanent functions during
1243-
// initialization. This breaks compatibility with HMS server of lower versions.
1244-
// To mitigate here we use `Hive.getWithFastCheck` instead which skips loading the permanent
1245-
// functions and therefore avoids calling `get_all_functions`.
1246-
override def getHive(hiveConf: HiveConf): Hive = Hive.getWithFastCheck(hiveConf, false)
12471236
}
12481237

12491238
private[client] class Shim_v2_2 extends Shim_v2_1

0 commit comments

Comments
 (0)