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



##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
##########
@@ -963,36 +975,45 @@ private[hive] class HiveClientImpl(
     clientLoader.createClient().asInstanceOf[HiveClientImpl]
   }
 
-  def reset(): Unit = withHiveState {
+  def reset(): Unit = withHiveState(2) {
     val allTables = client.getAllTables("default")
-    val (mvs, others) = allTables.asScala.map(t => client.getTable("default", 
t))
-      .partition(_.getTableType.toString.equals("MATERIALIZED_VIEW"))
+    val (mvs, others) = allTables.asScala.map(t => {
+      HiveCatalogMetrics.incrementHiveClientCalls(1)
+      client.getTable("default", t)
+    }).partition(_.getTableType.toString.equals("MATERIALIZED_VIEW"))
 
     // Remove materialized view first, otherwise caused a violation of foreign 
key constraint.
     mvs.foreach { table =>
       val t = table.getTableName
       logDebug(s"Deleting materialized view $t")
+      HiveCatalogMetrics.incrementHiveClientCalls(1)

Review comment:
       It's really messy to see this code in random places.




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