Yes, you need to supply a hash function which returns an integer. From HASH partitioning...
To partition a table using HASH partitioning, it is necessary to append to the CREATE TABLE statement a PARTITION BY HASH (expr) clause, where expr is an expression that returns an integer.
The simplest solution is to store your ID as an integer and convert it to a hex string as needed. This is faster than storing varchar and uses less memory.
Unfortunately your ID is also too large to fit into a bigint. It's about 92 bits. Instead, use varbinary(12)
(and varbinary(16) for 128 bit UUIDs).
Then you need to write a hash function to turn that varbinary value into an integer for hashing. Unfortunately I don't know how to do that in MySQL.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…