CREATE TABLE with all values in protobuf schema

This is related to my other topic.

I’m doing a

CREATE TABLE xxx
WITH (
  format = 'protbuf'
) AS
SELECT some_column, other_column, LATEST_BY_OFFSET(some_value)
FROM topic_stream
GROUP BY some_column, other_column
EMIT CHANGES;

The problem is that this creates a schema where the GROUP BY values are in the key_schema but not in the value schema. I’d like to output the results into a topic that has the two values in the value schema.

Is this possible? I’m somewhat confused about why this needs to put the group by values into a key schema. (we’re not using those at all)

because they are the key :slight_smile: That’s the point of an aggregation - it results in a table. A table is the latest state for a given key.

However, you can use AS_VALUE to create a copy of a key field into the value part of the message.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.