> For the complete documentation index, see [llms.txt](https://docs.starrocks.io/llms.txt). This page is also available as Markdown at its `.md` URL.

# Feature Support: Data Distribution

This document outlines the partitioning and bucketing features supported by StarRocks.

## Supported table types[​](#supported-table-types "Direct link to 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[​](#bucketing "Direct link to 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**.<br />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.<br />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+)    |                                                                                                                                                                                                                              |

note

From v4.1 onwards, the maximum size of a tablet is changed to 100 GB.

## Partitioning[​](#partitioning "Direct link to Partitioning")

| Feature                 | Key point               | Support status | Note                                                                                                                                                                                                                          |
| ----------------------- | ----------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Partitioning strategy   | Expression Partitioning | Yes (v3.1+)    | - Including Partitioning based on a time function expression (since v3.0) and Partitioning based on the column expression (since v3.1)<br />- Supported time functions: date_trunc, time_slice                              |
|                         | 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            | - Only Expression Partitioning and List Partitioning support String-type Partition Key.<br />- Range Partitioning does not support String-type Partition Key. You need to use str2date to transform the column to date types. |

### Differences between partitioning strategies[​](#differences-between-partitioning-strategies "Direct link to Differences between partitioning strategies")

|                                                     | Expression Partitioning                       |                                                                                 | Range Partitioning                                                                                              | List Partitioning                                                               |
| --------------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|                                                     | Time function expression-based Partitioning   | Column expression-based Partitioning                                            |                                                                                                                 |                                                                                 |
| Data type                                           | Date (DATE/DATETIME)                          | - String (except BINARY)<br />- Date (DATE/DATETIME)<br />- Integer and Boolean | - String (except BINARY) \[1]<br />- Date or timestamp \[1]<br />- Integer                                      | - String (except BINARY)<br />- Date (DATE/DATETIME)<br />- Integer and Boolean |
| 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 if the partitions are manually created in batch<br />- No if the dynamic partitioning strategy is adopted | 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](https://docs.starrocks.io/docs/table_design/data_distribution/list_partitioning.md).
