You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/05/07 06:10:44 UTC
[GitHub] [spark] viirya commented on a change in pull request #32446: [SPARK-35321][SQL] Don't register Hive permanent functions when creating Hive client
viirya commented on a change in pull request #32446:
URL: https://github.com/apache/spark/pull/32446#discussion_r627952904
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala
##########
@@ -1316,6 +1320,13 @@ 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)
Review comment:
should we make it final? If higher version overrides it accidentally, seems we don't have test to prevent it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org