confluentinc / confluentinc/kafka-tutorials

Ksql example to count messages is irritating

Open
#1,086 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
39
Forks
91
PR merge metrics
No merged PRs in 30d

Description

The example uses limit 1 which will give a random massage count, since the query is **NOT** processing all message. Without limit 1, after some second one have the correct count.

`SELECT 'X' AS X,
COUNT(*) AS MSG_CT
FROM TOPIC
GROUP BY 'X'
EMIT CHANGES LIMIT 1;`

![image](https://user-images.githubusercontent.com/26556185/154682009-1f49ae66-0a8e-4907-ae13-e0e69f848b91.png)

Can anyone explain, why the behavior is diffrent to whats describe in the example?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.