Our support for custom partitioning with Kafka sinks is now generally available. This feature allows users to specify a SQL expression that computes a hash for each message, which determines what partition to assign to the message.
-- General syntax.
CREATE SINK ... INTO KAFKA CONNECTION <name> (PARTITION BY = <expression>) ...;
-- Example.
CREATE SINK ... INTO KAFKA CONNECTION <name> (
PARTITION BY = kafka_murmur2(name || address)
) ...;
See our full documentation for more information on configuring custom partitioning for Kafka sinks.