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

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


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new f3067b3d66b branch-4.0: [fix](Hive) Fix insert failure for 
non-partitioned object storage tables (#58624)
f3067b3d66b is described below

commit f3067b3d66bcfefa429188eaf451f142e73447d0
Author: Calvin Kirs <[email protected]>
AuthorDate: Tue Dec 2 20:02:43 2025 +0800

    branch-4.0: [fix](Hive) Fix insert failure for non-partitioned object 
storage tables (#58624)
    
    #58606
---
 .../main/java/org/apache/doris/planner/HiveTableSink.java    | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/HiveTableSink.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/HiveTableSink.java
index 54dae1df135..22ceca331e5 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/HiveTableSink.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/HiveTableSink.java
@@ -48,12 +48,10 @@ import org.apache.doris.thrift.THiveSerDeProperties;
 import org.apache.doris.thrift.THiveTableSink;
 
 import com.google.common.base.Strings;
-import com.google.common.collect.Lists;
 import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
 import org.apache.hadoop.hive.metastore.api.Table;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Optional;
@@ -203,7 +201,7 @@ public class HiveTableSink extends 
BaseExternalTableDataSink {
 
         List<THivePartition> partitions = new ArrayList<>();
 
-        List<HivePartition> hivePartitions;
+        List<HivePartition> hivePartitions = new ArrayList<>();
         if (targetTable.isPartitionedTable()) {
             // Get partitions from cache instead of HMS client (similar to 
HiveScanNode)
             HiveMetaStoreCache cache = Env.getCurrentEnv().getExtMetaCacheMgr()
@@ -213,14 +211,6 @@ public class HiveTableSink extends 
BaseExternalTableDataSink {
             List<List<String>> partitionValuesList =
                     new 
ArrayList<>(partitionValues.getPartitionValuesMap().values());
             hivePartitions = cache.getAllPartitionsWithCache(targetTable, 
partitionValuesList);
-        } else {
-            // Non-partitioned table, create dummy partition
-            hivePartitions = Lists.newArrayList();
-            StorageDescriptor sd = targetTable.getRemoteTable().getSd();
-            HivePartition dummyPartition = new 
HivePartition(targetTable.getOrBuildNameMapping(), true,
-                    sd.getInputFormat(), sd.getLocation(), 
Lists.newArrayList(),
-                    sd.getParameters() != null ? sd.getParameters() : new 
HashMap<>());
-            hivePartitions.add(dummyPartition);
         }
 
         // Convert HivePartition to THivePartition (same logic as before)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to