Closed bobbyiliev closed 1 month ago
One quick note: PARTITION BY accepts any SQL expression, not just column names. I don’t think it changes things for you too much, as you’ll still want to take the expression as a string, but you won’t want to escape it as an identifier like you normally would.
Feature request
Materialize has recently added support for custom partitioning in Kafka sinks using the
PARTITION BY
clause. This allows users to partition data based on specific columns, such as customer ID, ensuring that related data (e.g., orders for the same customer) are grouped into the same partition. This is particularly useful when working with upsert semantics to retain only the latest state of each record in a Kafka topic.Proposed Solution
materialize_sink_kafka
resource in the Terraform provider to include a new argument forpartition_by
.partition_by
argument should accept a list of column names that will be used for partitioning Kafka sink data.partition_by
option, including examples of its usage.References