[feature](autobucekt) Add support autobucket min buckets config Add support autobucket (#24920)
Signed-off-by: Jack Drogon <jack.xsuperman@gmail.com>
This commit is contained in:
@ -122,7 +122,7 @@ public class CreateTableStmt extends DdlStmt {
|
||||
} else {
|
||||
long partitionSize = ParseUtil
|
||||
.analyzeDataVolumn(newProperties.get(PropertyAnalyzer.PROPERTIES_ESTIMATE_PARTITION_SIZE));
|
||||
distributionDesc.setBuckets(AutoBucketUtils.getBucketsNum(partitionSize));
|
||||
distributionDesc.setBuckets(AutoBucketUtils.getBucketsNum(partitionSize, Config.autobucket_min_buckets));
|
||||
}
|
||||
|
||||
return newProperties;
|
||||
|
||||
@ -221,7 +221,7 @@ public class DynamicPartitionScheduler extends MasterDaemon {
|
||||
|
||||
// plus 5 for uncompressed data
|
||||
long uncompressedPartitionSize = getNextPartitionSize(partitionSizeArray) * 5;
|
||||
return AutoBucketUtils.getBucketsNum(uncompressedPartitionSize);
|
||||
return AutoBucketUtils.getBucketsNum(uncompressedPartitionSize, Config.autobucket_min_buckets);
|
||||
}
|
||||
|
||||
private ArrayList<AddPartitionClause> getAddPartitionClause(Database db, OlapTable olapTable,
|
||||
|
||||
@ -95,4 +95,9 @@ public class AutoBucketUtils {
|
||||
logger.debug("AutoBucketsUtil: final bucketsNum {}", bucketsNum);
|
||||
return bucketsNum;
|
||||
}
|
||||
|
||||
public static int getBucketsNum(long partitionSize, int minBuckets) {
|
||||
int bucketsNum = getBucketsNum(partitionSize);
|
||||
return Math.max(minBuckets, bucketsNum);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user