Skip to content

Commit

Permalink
[debug](auto-partition) debug auto&dynamic partition creation (apache…
Browse files Browse the repository at this point in the history
…#40245)

## Proposed changes

Issue Number: close #xxx

<!--Describe your changes.-->
  • Loading branch information
zclllyybb authored Sep 2, 2024
1 parent 00f3f4c commit d321841
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3350,7 +3350,7 @@ public TCreatePartitionResult createPartition(TCreatePartitionRequest request) t
return result;
}

Table table = db.getTable(tableId).get();
OlapTable table = (OlapTable) (db.getTable(tableId).get());
if (table == null) {
errorStatus.setErrorMsgs(
(Lists.newArrayList(String.format("dbId=%d tableId=%d is not exists", dbId, tableId))));
Expand Down Expand Up @@ -3432,6 +3432,16 @@ public TCreatePartitionResult createPartition(TCreatePartitionRequest request) t
List<TTabletLocation> tablets = Lists.newArrayList();
for (String partitionName : addPartitionClauseMap.keySet()) {
Partition partition = table.getPartition(partitionName);
if (partition == null) {
String partInfos = table.getAllPartitions().stream()
.map(partitionArg -> partitionArg.getName() + partitionArg.getId())
.collect(Collectors.joining(", "));

errorStatus.setErrorMsgs(Lists.newArrayList("get partition " + partitionName + " failed"));
result.setStatus(errorStatus);
LOG.warn("send create partition error status: {}, {}", result, partInfos);
return result;
}
TOlapTablePartition tPartition = new TOlapTablePartition();
tPartition.setId(partition.getId());
int partColNum = partitionInfo.getPartitionColumns().size();
Expand Down

0 comments on commit d321841

Please sign in to comment.