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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]