Feature Support: Data Distribution
This document outlines the partitioning and bucketing features supported by StarRocks.
Supported table types
-
Bucketing
Hash Bucketing is supported in all table types. Random Bucketing (from v3.1 onwards) is supported only in Duplicate Key tables.
-
Partitioning
Expression Partitioning (from v3.1 onwards), Range Partitioning, and List Partitioning (from v3.1 onwards) are supported in all table types.
Bucketing
Feature | Key point | Support status | Note |
---|---|---|---|
Bucketing strategy | Hash Bucketing | Yes | |
Random Bucketing | Yes (v3.1+) | Random Bucketing is supported only in Duplicate Key tables. From v3.2, StarRocks supports dynamically adjusting the number of tablets to create according to cluster information and the data size. | |
Bucket Key data type | Date, Integer, String | Yes | |
Bucket number | Automatically set the number of buckets | Yes (v3.0+) | Automatically determined by the number of BE nodes or the data volume of the largest historical partition. The logic has been optimized separately for partitioned tables and non-partitioned tables in later versions. |
Dynamic increase of the Bucket number for Random Bucketing | Yes (v3.2+) |
Partitioning
Feature | Key point | Support status | Note |
---|---|---|---|
Partitioning strategy | Expression Partitioning | Yes (v3.1+) |
|
Range Partitioning | Yes (v3.2+) | Since v3.3.0, three specific time functions can be used for Partition Keys: from_unixtime, from_unixtime_ms, str2date, substr/substring. | |
List Partitioning | Yes (v3.1+) | ||
Partition Key data type | Date, Integer, Boolean | Yes | |
String | Yes |
|
Differences between partitioning strategies
Expression Partitioning | Range Partitioning | List Partitioning | ||
---|---|---|---|---|
Time function expression-based Partitioning | Column expression-based Partitioning | |||
Data type | Date (DATE/DATETIME) |
|
|
|
Support for multiple Partition Keys | / (Only supports one date-type Partition Key) | Yes | Yes | Yes |
Support Null values for Partition Keys | Yes | / [2] | Yes | / [2] |
Manual creation of partitions before data loading | / [3] | / [3] |
| Yes |
Automatic creation of partitions while data loading | Yes | Yes | / | / |
note
- [1]: You need to use from_unixtime, str2date or other time functions to transform the column to date types.
- [2]: Null values will be supported in Partition Keys for List Partitioning from v3.3.3 onwards.
- [3]: Partitions are automatically created.
For detailed comparisons between List Partitioning and Expression Partitioning, refer to Comparison between list partitioning and expression partitioning.