HASH Partitioning Type
PARTITION BY HASH (partitioning_expression) [PARTITIONS(number_of_partitions)]
HASH partitioning is a form of partitioning in which the server takes care of the partition in which to place the data, ensuring an even distribution among the partitions.
It requires a column value, or an expression based on a column value, which is hashed, as well as the number of partitions into which to divide the table.
partitioning_expression needs to return a non-constant, deterministic integer. It is evaluated for each insert and update, so overly complex expressions can lead to performance issues.
number_of_partitions is a positive integer specifying the number of partitions into which to divide the table. If the
PARTITIONS clause is omitted, the default number of partitions is one.
CREATE OR REPLACE TABLE t1 (c1 INT, c2 DATETIME) PARTITION BY HASH(TO_DAYS(c2)) PARTITIONS 5;