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


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/compaction/IcebergTableOptimizer.java:
##########
@@ -71,34 +69,21 @@ public IcebergTableOptimizer(HiveConf conf, TxnStore 
txnHandler, MetadataCache m
    * @param skipTables A {@link Set} of fully qualified table names to 
explicitly skip during the scan.
    * @return A {@link Set} of {@link CompactionInfo} objects representing 
tables and/or partitions
    * identified as eligible for compaction.
-   * @throws MetaException If an unrecoverable error occurs during Metastore 
communication or
    * during {@link SessionState} initialization.
    */
   @Override
   public Set<CompactionInfo> findPotentialCompactions(long lastChecked, 
ShowCompactResponse currentCompactions,
-      Set<String> skipDBs, Set<String> skipTables) throws MetaException {
+      Set<String> skipDBs, Set<String> skipTables) {
     Set<CompactionInfo> compactionTargets = Sets.newHashSet();
-    try {
-      SessionState sessionState = SessionState.get();
-      if (sessionState == null) {
-        sessionState = new SessionState(conf);
-        SessionState.start(sessionState);
-      }
-    } catch (Exception e) {
-      throw new MetaException(String.format("Error while finding compaction 
targets for Iceberg tables: %s",
-          e.getMessage()));
-    }
 
-    getDatabases().stream()
-        .filter(dbName -> !skipDBs.contains(dbName))
-        .flatMap(dbName -> getTables(dbName).stream()
-            .map(tableName -> TableName.getDbTable(dbName, tableName)))
-        .filter(qualifiedTableName -> !skipTables.contains(qualifiedTableName))
-        .map(qualifiedTableName -> Pair.of(qualifiedTableName, 
resolveMetastoreTable(qualifiedTableName)))
+    getTables().stream()
+        .filter(table -> !skipDBs.contains(table.getDb()))

Review Comment:
   can't we pass the skip filters directly to a TableFetcher?



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