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/10/27 14:22:03 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #34400: [SPARK-36975][SQL] Correct the hive client calls‘s metrics in HiveClientImpl

cloud-fan commented on a change in pull request #34400:
URL: https://github.com/apache/spark/pull/34400#discussion_r737521796



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala
##########
@@ -379,20 +392,26 @@ private[client] class Shim_v0_12 extends Shim with Logging {
       database: String,
       tableName: String,
       parts: Seq[CatalogTablePartition],
-      ignoreIfExists: Boolean): Unit = {
+      ignoreIfExists: Boolean): Unit = withHiveCall {
     val table = hive.getTable(database, tableName)
     parts.foreach { s =>
       val location = s.storage.locationUri.map(
         uri => new Path(table.getPath, new Path(uri))).orNull
       val params = if (s.parameters.nonEmpty) s.parameters.asJava else null
       val spec = s.spec.asJava
+      // Since Spark don't know if it will throw exception when iterate all parts.
+      // So Spark increase the hive client call metrics here when invoke getTable().
+      HiveCatalogMetrics.incrementHiveClientCalls(1)
       if (hive.getPartition(table, spec, false) != null && ignoreIfExists) {

Review comment:
       shall we call the shim method here as well?




-- 
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: reviews-unsubscribe@spark.apache.org

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