Skip to content

Commit

Permalink
[fix](judge-partition) Fix incorrect logic in determining whether it …
Browse files Browse the repository at this point in the history
…is a partitioned table (apache#27515)

The old logic used to determine whether it was a partition table based on the number of buckets, but if I had a partition table with only one partition and the number of buckets in that partition was 1, it would be mistakenly recognized as a non partition table.

```
Table[test_load_doris_to_hive_2] is not partitioned
```
  • Loading branch information
whutpencil authored and morningman committed Dec 13, 2023
1 parent 6bf0700 commit 7c69a8f
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1252,14 +1252,7 @@ public Status getIntersectPartNamesWith(OlapTable anotherTbl, List<String> inter

@Override
public boolean isPartitioned() {
int numSegs = 0;
for (Partition part : getPartitions()) {
numSegs += part.getDistributionInfo().getBucketNum();
if (numSegs > 1) {
return true;
}
}
return false;
return !PartitionType.UNPARTITIONED.equals(partitionInfo.getType());
}

@Override
Expand Down

0 comments on commit 7c69a8f

Please sign in to comment.