sunchao commented on a change in pull request #32446:
URL: https://github.com/apache/spark/pull/32446#discussion_r627972603



##########
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:
       Hmm I don't see why ppl would intentionally override this while ignoring 
the rationale here. On the other hand we might need to override it again in 
case Hive changes in an incompatible way (say, `Hive.getWithFastCheck` starts 
to call another newly introduced HMS thrift API).




-- 
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]

Reply via email to