[fix](spark load)Temp partition with spark load (#14648)
* [fix](spark load)losing temporary partition item entry * [fix](spark load)Temp partition with spark load
This commit is contained in:
@ -25,6 +25,7 @@ import org.apache.doris.common.util.RangeUtils;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Range;
|
||||
|
||||
import java.io.DataInput;
|
||||
@ -77,6 +78,19 @@ public class RangePartitionInfo extends PartitionInfo {
|
||||
return itemEntryList;
|
||||
}
|
||||
|
||||
public List<Map.Entry<Long, PartitionItem>> getAllPartitionItemEntryList(boolean isSorted) {
|
||||
Map<Long, PartitionItem> tmpMap = Maps.newHashMap();
|
||||
|
||||
tmpMap.putAll(idToItem);
|
||||
tmpMap.putAll(idToTempItem);
|
||||
|
||||
List<Map.Entry<Long, PartitionItem>> itemEntryList = Lists.newArrayList(tmpMap.entrySet());
|
||||
if (isSorted) {
|
||||
Collections.sort(itemEntryList, RangeUtils.RANGE_MAP_ENTRY_COMPARATOR);
|
||||
}
|
||||
return itemEntryList;
|
||||
}
|
||||
|
||||
// create a new range and check it.
|
||||
private Range<PartitionKey> createAndCheckNewRange(PartitionKeyDesc partKeyDesc, boolean isTemp)
|
||||
throws AnalysisException, DdlException {
|
||||
|
||||
@ -334,7 +334,7 @@ public class SparkLoadPendingTask extends LoadTask {
|
||||
partitionColumnRefs.add(column.getName());
|
||||
}
|
||||
|
||||
for (Map.Entry<Long, PartitionItem> entry : rangePartitionInfo.getPartitionItemEntryList(false, true)) {
|
||||
for (Map.Entry<Long, PartitionItem> entry : rangePartitionInfo.getAllPartitionItemEntryList(true)) {
|
||||
long partitionId = entry.getKey();
|
||||
if (!partitionIds.contains(partitionId)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user