deniskuzZ commented on code in PR #5957:
URL: https://github.com/apache/hive/pull/5957#discussion_r2217788444


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/compaction/IcebergTableOptimizer.java:
##########
@@ -115,27 +134,19 @@ private List<org.apache.hadoop.hive.common.TableName> 
getTables() {
     }
   }
 
-  private List<String> getPartitions(org.apache.iceberg.Table icebergTable) {
-    try {
-      return IcebergTableUtil.getPartitionNames(icebergTable, 
Maps.newHashMap(), true);
-    } catch (SemanticException e) {
-      throw new RuntimeMetaException(e, "Error getting partition names for 
Iceberg table %s", icebergTable.name());
-    }
-  }
-
-  private Table resolveMetastoreTable(String qualifiedTableName) {
-    String[] dbTableName = TxnUtils.getDbTableName(qualifiedTableName);
+  private org.apache.hadoop.hive.ql.metadata.Table getHiveTable(String dbName, 
String tableName) {
     try {
-      return metadataCache.computeIfAbsent(qualifiedTableName,
-          () -> CompactorUtil.resolveTable(conf, dbTableName[0], 
dbTableName[1]));
+      Table metastoreTable = 
metadataCache.computeIfAbsent(TableName.getDbTable(dbName, tableName), () ->
+          CompactorUtil.resolveTable(conf, dbName, tableName));
+      return new org.apache.hadoop.hive.ql.metadata.Table(metastoreTable);
     } catch (Exception e) {
-      throw new RuntimeMetaException(e, "Error resolving table %s", 
qualifiedTableName);
+      throw new RuntimeMetaException(e, "Error getting Hive table");

Review Comment:
   could we keep the table name in the exception



-- 
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-unsubscr...@hive.apache.org

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


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

Reply via email to