LuciferYang commented on code in PR #43189:
URL: https://github.com/apache/spark/pull/43189#discussion_r1342145839


##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala:
##########
@@ -266,56 +257,8 @@ private[client] class Shim_v2_0 extends Shim with Logging {
   // txnId can be 0 unless isAcid == true
   protected lazy val txnIdInLoadDynamicPartitions: JLong = 0L
 
-  protected lazy val getMSCMethod = {
-    // Since getMSC() in Hive 0.12 is private, findMethod() could not work here
-    val msc = classOf[Hive].getDeclaredMethod("getMSC")
-    msc.setAccessible(true)
-    msc
-  }
-
-  override def getMSC(hive: Hive): IMetaStoreClient = {
-    getMSCMethod.invoke(hive).asInstanceOf[IMetaStoreClient]
-  }
+  override def getMSC(hive: Hive): IMetaStoreClient = hive.getMSC

Review Comment:
   Which approach is better, providing a default implementation in the template 
class `abstract class Shim` or `override` in the specific class?



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

To unsubscribe, e-mail: [email protected]

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