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/21 08:20:10 UTC
[GitHub] [spark] AngersZhuuuu commented on a change in pull request #34241: [SPARK-36975][SQL] Correct the hive client calls‘s metrics in HiveClientImpl
AngersZhuuuu commented on a change in pull request #34241:
URL: https://github.com/apache/spark/pull/34241#discussion_r733433538
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
##########
@@ -372,13 +374,15 @@ private[hive] class HiveClientImpl(
CatalogUtils.URIToString(database.locationUri),
(props -- Seq(PROP_OWNER)).asJava)
props.get(PROP_OWNER).orElse(userName).foreach { ownerName =>
+ HiveCatalogMetrics.incrementHiveClientCalls(1)
shim.setDatabaseOwnerName(hiveDb, ownerName)
}
hiveDb
}
override def getDatabase(dbName: String): CatalogDatabase = withHiveState {
Option(client.getDatabase(dbName)).map { d =>
+ HiveCatalogMetrics.incrementHiveClientCalls(1)
Review comment:
> why not use `withHiveState(2)`?
```
public Database getDatabase(String dbName) throws HiveException {
try {
return this.getMSC().getDatabase(dbName);
} catch (NoSuchObjectException var3) {
return null;
} catch (Exception var4) {
throw new HiveException(var4);
}
}
```
If return null, won't have the second call.
--
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