KEY Partitioning Type
PARTITION BY KEY (column_value) [PARTITIONS (number_of_partitions)]
Partitioning by key is a type of partitioning that is similar to and can be used in a similar way as partitioning by hash.
Just like HASH partitioning, in KEY partitioning the server takes care of the partition and ensures an even distribution among the partitions. However, the largest difference is that KEY partitioning requires a column_value, and cannot accept a partitioning_expression which is based on a column_value, in contrast to HASH partitioning, which can.
It requires a column_value, and the hashing function is given by the server.
CREATE OR REPLACE TABLE t1 (v1 INT) PARTITION BY KEY (v1) PARTITIONS 2;