You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2025/12/08 09:28:23 UTC

(doris) branch branch-3.1 updated: branch-3.1: [fix](hive) fix potential inconsistent hive partition info cache #58707 (#58797)

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

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 389de3487e7 branch-3.1: [fix](hive) fix potential inconsistent hive partition info cache #58707 (#58797)
389de3487e7 is described below

commit 389de3487e7cc948672ee5a69dffc965ed18b280
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Mon Dec 8 17:28:16 2025 +0800

    branch-3.1: [fix](hive) fix potential inconsistent hive partition info cache #58707 (#58797)
    
    Cherry-picked from #58707
    
    Co-authored-by: Mingyu Chen (Rayner) <mo...@163.com>
---
 .../main/java/org/apache/doris/datasource/hive/HMSExternalTable.java | 5 ++++-
 .../java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java
index 893d9fdb5d1..e7e2125f41d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java
@@ -714,7 +714,10 @@ public class HMSExternalTable extends ExternalTable implements MTMVRelatedTableI
     }
 
     private List<Column> initPartitionColumns(List<Column> schema) {
-        List<String> partitionKeys = remoteTable.getPartitionKeys().stream().map(FieldSchema::getName)
+        // get table from remote, do not use `remoteTable` directly,
+        // because here we need to get schema from latest table info.
+        Table newTable = ((HMSExternalCatalog) catalog).getClient().getTable(dbName, name);
+        List<String> partitionKeys = newTable.getPartitionKeys().stream().map(FieldSchema::getName)
                 .collect(Collectors.toList());
         List<Column> partitionColumns = Lists.newArrayListWithCapacity(partitionKeys.size());
         for (String partitionKey : partitionKeys) {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java
index 0582a6cd8b4..bf91cc33a0c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java
@@ -139,6 +139,8 @@ public class IcebergMetadataOps implements ExternalMetadataOps {
         try {
             return executionAuthenticator.execute(() -> listNestedNamespaces(getNamespace()));
         } catch (Exception e) {
+            LOG.warn("failed to list database names in catalog {}, root cause: {}",
+                    dorisCatalog.getName(), Util.getRootCauseMessage(e), e);
             throw new RuntimeException("Failed to list database names, error message is:" + e.getMessage(), e);
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org