From 36a528b6bca4cc73de5673949ed4b4ba12b6e957 Mon Sep 17 00:00:00 2001 From: HB Date: Mon, 27 Nov 2023 18:56:52 +0800 Subject: [PATCH] [fix](judge-partition) Fix incorrect logic in determining whether it is a partitioned table (#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 ``` --- .../main/java/org/apache/doris/catalog/OlapTable.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java index 4cfc8c99ac..54c881e682 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java @@ -1312,14 +1312,7 @@ public class OlapTable extends Table { @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