You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "akshat0395 (via GitHub)" <gi...@apache.org> on 2023/03/07 06:48:31 UTC

[GitHub] [hive] akshat0395 commented on a diff in pull request #4098: HIVE-27122: Use Caffeine for caching metadata objects in Compactor threads

akshat0395 commented on code in PR #4098:
URL: https://github.com/apache/hive/pull/4098#discussion_r1127398769


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorUtil.java:
##########
@@ -133,6 +150,24 @@ public static List<Partition> getPartitionsByNames(HiveConf conf, String dbName,
     }
   }
 
+  public static Database resolveDatabase(HiveConf conf, String dbName) throws MetaException, NoSuchObjectException {
+    try {
+      return getMSForConf(conf).getDatabase(MetaStoreUtils.getDefaultCatalog(conf), dbName);
+    } catch (NoSuchObjectException e) {
+      LOG.error("Unable to find database {}, {}", dbName, e.getMessage());
+      throw e;
+    }
+  }
+
+  public static Table resolveTable(HiveConf conf, String dbName, String tableName) throws MetaException {
+    try {
+      return getMSForConf(conf).getTable(MetaStoreUtils.getDefaultCatalog(conf), dbName, tableName);
+    } catch (MetaException e) {
+      LOG.error("Unable to find database {}, {}", dbName, e.getMessage());

Review Comment:
   This method is resolving for table, This log should be `Unable to find Table {}, {}`, tableName



##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorUtil.java:
##########
@@ -74,6 +77,20 @@ static Runnable unchecked(ThrowingRunnable<?> r) {
     }
   }
 
+  public interface ThrowingFunction<T, R, E extends Exception> {

Review Comment:
   Can we please add comments to this method to reduce the cognitive complexity of this method



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org