Hi,
I’m facing an issue that for sure I’m doing something wrong, but I have no idea what.
I’ve created a table from a topic that I’m feeding from a python microservice. Also I am sending a key. Then I created a table like that:
CREATE TABLE eb_chat_session (ID_PK VARCHAR PRIMARY KEY, ID_USER VARCHAR, EMAIL VARCHAR, ID_SESSION VARCHAR, TYPE_CHAT VARCHAR, QUESTION_INDEX VARCHAR, FROM_BOT BOOLEAN, FIRST_NAME VARCHAR) WITH (KAFKA_TOPIC='eb_chat_session', VALUE_FORMAT='JSON');
Description:
Name : EB_CHAT_SESSION
Type : TABLE
Timestamp field : Not set - using <ROWTIME>
Key format : KAFKA
Value format : JSON
Kafka topic : eb_chat_session (partitions: 25, replication: 1)
Statement : CREATE TABLE EB_CHAT_SESSION (ID_PK STRING PRIMARY KEY, ID_USER STRING, EMAIL STRING, ID_SESSION STRING, TYPE_CHAT STRING, QUESTION_INDEX STRING, FROM_BOT BOOLEAN, FIRST_NAME STRING) WITH (KAFKA_TOPIC='eb_chat_session', KEY_FORMAT='KAFKA', VALUE_FORMAT='JSON');
Field | Type
-------------------------------------------------
ID_PK | VARCHAR(STRING) (primary key)
ID_USER | VARCHAR(STRING)
EMAIL | VARCHAR(STRING)
ID_SESSION | VARCHAR(STRING)
TYPE_CHAT | VARCHAR(STRING)
QUESTION_INDEX | VARCHAR(STRING)
FROM_BOT | BOOLEAN
FIRST_NAME | VARCHAR(STRING)
-------------------------------------------------
Local runtime statistics
------------------------
(Statistics of the local KSQL server interaction with the Kafka topic eb_chat_session)
And then I’ve created a queryable table:
CREATE TABLE EB_SESSION_MAT_TABLE AS SELECT * FROM EB_CHAT_SESSION;
Now the problem:
When I try to filter by ID_PK, which is the key, I get nothing:
SELECT * FROM EB_SESSION_MAT_TABLE WHERE ID_PK = 'spaces/nMdVCYAAAAE';
But if I filter by ID_SESSION which contains the same value of ID_PK I get a row:
SELECT * FROM EB_SESSION_MAT_TABLE WHERE ID_SESSION = 'spaces/nMdVCYAAAAE';
I’d would like to undertand why I’m not able to filter by KEY.
An update here:
If I use ‘=’ it does not bring nothing, but if I use ‘!=’ or ‘<>’ it brings everthing different of the specified value, as it should be, of course:
SELECT * FROM EB_SESSION_MAT_TABLE WHERE ID_PK <> 'spaces/nMdVCYAAAAE';
Thanks