Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@
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;
Expand Down Expand Up @@ -203,7 +201,7 @@ private void setPartitionValues(THiveTableSink tSink) throws AnalysisException {

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()
Expand All @@ -213,14 +211,6 @@ private void setPartitionValues(THiveTableSink tSink) throws AnalysisException {
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)
Expand Down
Loading