You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2026/03/26 18:22:03 UTC

(impala) 01/08: IMPALA-14803: Speed up Iceberg table minimal topic updates

This is an automated email from the ASF dual-hosted git repository.

michaelsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit a04b8184009e619dba7022abddd2e0fc5f569ab8
Author: Csaba Ringhofer <cs...@cloudera.com>
AuthorDate: Tue Mar 3 17:25:48 2026 +0100

    IMPALA-14803: Speed up Iceberg table minimal topic updates
    
    Before this patch only HdfsTable was optimized for minimal topic
    updates and IcebergTable created Thrift objects that included
    all file descriptors. Most of the info in the Thrift object
    is not used later in minimal topic mode (see
    CatalogServiceCatalog#getMinimalObjectForV2). The patch
    changes all table types other than HdfsTable to create
    minimal Thrift representation.
    
    The minimal topic update Thrift generation for an 1M file Iceberg
    table decreased from around 0.5s to <1ms. I don't expect
    noticable change for other table types as only HdfsTable and
    IcebergTable have file descriptor lists.
    
    Change-Id: If037a855dc5d2c4292347b34ebe0221477eae2fe
    Reviewed-on: http://gerrit.cloudera.org:8080/24064
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 .../org/apache/impala/catalog/CatalogServiceCatalog.java | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java b/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java
index 41599f3c0..06fa35337 100644
--- a/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java
+++ b/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java
@@ -1919,8 +1919,6 @@ public class CatalogServiceCatalog extends Catalog {
     Preconditions.checkState(tbl.isReadLockedByCurrentThread(),
         "Topic update thread does not hold a lock on table " + tbl.getFullName()
             + " while generating catalog delta");
-    TCatalogObject catalogTbl =
-        new TCatalogObject(TABLE, Catalog.INITIAL_CATALOG_VERSION);
     long tblVersion = tbl.getCatalogVersion();
     if (tblVersion <= ctx.fromVersion) {
       LOG.trace("Table {} version {} skipping the update ({}, {}]",
@@ -1942,25 +1940,25 @@ public class CatalogServiceCatalog extends Catalog {
               topicUpdateEntry.getNumSkippedUpdatesLockContention()));
       return;
     }
+    TCatalogObject catalogTbl = null;
     try {
       if (BackendConfig.INSTANCE.isIncrementalMetadataUpdatesEnabled()
           && tbl instanceof HdfsTable) {
+        catalogTbl =
+            new TCatalogObject(TABLE, tbl.getCatalogVersion());
+        catalogTbl.setLast_modified_time_ms(tbl.getLastLoadedTimeMs());
         catalogTbl.setTable(((HdfsTable) tbl).toThriftWithMinimalPartitions());
         addHdfsPartitionsToCatalogDelta((HdfsTable) tbl, ctx);
+      } else if (topicMode_ == TopicMode.MINIMAL) {
+        catalogTbl = tbl.toInvalidationObject();
       } else {
-        catalogTbl.setTable(tbl.toThrift());
-      }
-      // Update catalog object type from TABLE to VIEW if it's indeed a view.
-      if (TImpalaTableType.VIEW == tbl.getTableType()) {
-        catalogTbl.setType(TCatalogObjectType.VIEW);
+        catalogTbl = tbl.toTCatalogObject();
       }
     } catch (Exception e) {
       LOG.error(String.format("Error calling toThrift() on table %s: %s",
           tbl.getFullName(), e.getMessage()), e);
       return;
     }
-    catalogTbl.setCatalog_version(tbl.getCatalogVersion());
-    catalogTbl.setLast_modified_time_ms(tbl.getLastLoadedTimeMs());
     ctx.addCatalogObject(catalogTbl, false);
   }