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