I have a source table that looks like this:
+------------------------------------------------------------+------------------------------------------------------------+
|ROWTIME |id |
+------------------------------------------------------------+------------------------------------------------------------+
|1718204168745 |"2337" |
|1718101864313 |"1337" |
|1718265930643 |"3337" |
|1718204113848 |2337 |
|1718204231979 |"2337" |
|1718263392544 |3337 |
The id
column is the primary key.
I try to query the data and filter on the id
SELECT RowTime, `id` FROM `Data` WHERE `id` = '"2337"';
+------------------------------------------------+------------------------------------------------+
|ROWTIME |id |
+------------------------------------------------+------------------------------------------------+
|1718204231979 |"2337" |
Query terminated
SELECT RowTime, `id` FROM `Data` WHERE `id` = '"1337"';
+------------------------------------------------+------------------------------------------------+
|ROWTIME |id |
+------------------------------------------------+------------------------------------------------+
Query terminated
SELECT RowTime, `id` FROM `Data` WHERE `id` = '"3337"';
+------------------------------------------------+------------------------------------------------+
|ROWTIME |id |
+------------------------------------------------+------------------------------------------------+
|1718265930643 |"3337" |
Query terminated
SELECT RowTime, `id` FROM `Data` WHERE `id` = '2337';
+------------------------------------------------+------------------------------------------------+
|ROWTIME |id |
+------------------------------------------------+------------------------------------------------+
Query terminated
SELECT RowTime, `id` FROM `Data` WHERE `id` = '"2337"';
+------------------------------------------------+------------------------------------------------+
|ROWTIME |id |
+------------------------------------------------+------------------------------------------------+
|1718204231979 |"2337" |
Query terminated
```sql
SELECT RowTime, `id` FROM `Data` WHERE `id` = '3337';
+------------------------------------------------+------------------------------------------------+
|ROWTIME |id |
+------------------------------------------------+------------------------------------------------+
Query terminated
When I export the messages from the topic using confluent cloud I see this
partition offset timestamp timestampType key value headers exceededFields
2 9 1718265930643 "CREATE_TIME" "3337" {"id":"3337"} [] null
5 18 1718263392544 "CREATE_TIME" 3337 {"id":"3337"} [] null
5 17 1718204231979 "CREATE_TIME" "2337" {"id":"2337"} [] null
0 15 1718204168745 "CREATE_TIME" "2337" {"id":"2337"} [] null
2 8 1718204113848 "CREATE_TIME" 2337 {"id":"2337"} [] null
3 34 1718203440401 "CREATE_TIME" "1337" "" [] null
I have produced some messages using the confluent cloud UI and some using confluent-cli
confluent kafka topic produce dev-streaming --parse-key --key-format string
Starting Kafka Producer. Use Ctrl-C to exit.
3337:{"id":"3337"}
Why do I have the same key in different partitions and why can’t I filter on some of the ids?
It looks like I can filter on the ids hat I entered using the UI but not the ones i entered using confluent-cli.