I am new to Ksql and trying aggregation, have created a Kstream & a Ktable which looks like this
kstream...
CREATE STREAM test
(id BIGINT,
type VARCHAR,
sales BIGINT
WITH (KAFKA_TOPIC='test1',
VALUE_FORMAT='JSON');
ktable...
CREATE TABLE test_total AS
SELECT ID,
SUM(SALES) AS TOTAL_SALES
FROM test
GROUP BY ID
EMIT CHANGES;
Published these values into Kafka test1 topic
{"id": 1, "type": "test","sales": 200}
{"id": 1, "type": "test","sales": 300}
When I use the Kafka console consumer I only see the output as
{"TOTAL_SALES":200} {"TOTAL_SALES":500}
How can I see the id also printed into the Kafka topic? Do I have to create some kind of view out of the table?