Group by column not seen in result

I created this table

CREATE TABLE k_events WITH (KAFKA_TOPIC='t_events', KEY_FORMAT='KAFKA', VALUE_FORMAT='JSON') as SELECT id, COLLECT_LIST(output) as machine_condition from k_merged WINDOW TUMBLING (SIZE 5 SECOND) GROUP BY id emit changes;

When I browse the topic, I can see the id as the key of the message. But, I don’t see in the message itself. For example, I am expecting the messages in t_events as

{ "id":"uuid", 
"machine_condition": []
}

Instead, I only see

{ "machine_condition": []}

What am I missing?

Id is the primary key because it’s the GROUP BY clause (see here on how the key is determined). It won’t also show up in the value automatically, but you can use the AS_VALUE function to copy the key into the value.

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