diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DistributionDescriptor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DistributionDescriptor.java index 056bfd20897f19..3e4d007ff5b913 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DistributionDescriptor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DistributionDescriptor.java @@ -73,7 +73,8 @@ public void updateBucketNum(int bucketNum) { */ public void validate(Map columnMap, KeysType keysType) { if (bucketNum <= 0) { - throw new AnalysisException("Buckets number of distribution should be greater than zero."); + throw new AnalysisException(isHash ? "Number of hash distribution should be greater than zero." + : "Number of random distribution should be greater than zero."); } if (isHash) { Set colSet = Sets.newHashSet(cols); diff --git a/regression-test/suites/table_p0/test_table_with_buckets.groovy b/regression-test/suites/table_p0/test_table_with_buckets.groovy index efec750839de3a..42917093b41b00 100644 --- a/regression-test/suites/table_p0/test_table_with_buckets.groovy +++ b/regression-test/suites/table_p0/test_table_with_buckets.groovy @@ -23,7 +23,7 @@ suite('test_table_with_buckets') { try { test { sql "create table ${tbl1}(k int) distributed by hash(k) buckets 0 properties('replication_num' = '1')" - exception 'Buckets number of distribution should be greater than zero.' + exception 'Number of hash distribution should be greater than zero.' } test {