Where clause in Create stream ignored

Hi

I have created a stream

CREATE STREAM LOGINS WITH (KAFKA_TOPIC='imagen', PARTITIONS=1, REPLICAS=1, VALUE_FORMAT='JSON') AS SELECT *
FROM IMAGEN IMAGEN
WHERE (IMAGEN.ACTION LIKE 'Login')
EMIT CHANGES;

When I look at the stream it contains all actions. ie Edit, View as well as Login. It doesn’t seem to matter what where clause I enter, it is just ignored

Hi @robcam73 !

What is the definition of IMAGEN?

Best,
Bruno

Hi

CREATE STREAM IMAGEN (IMAGENID STRING KEY,  USERID BIGINT, CATEGORY STRING, 
ORGANISATIONID BIGINT, DEPARTMENTID BIGINT, ACTION STRING, SUBACTION STRING, 
OBJECTID BIGINT, OBJECTTYPE STRING, OBJECTORG BIGINT, FQDN STRING, 
REFERRER STRING) 
WITH (KAFKA_TOPIC='imagen', KEY_FORMAT='KAFKA', VALUE_FORMAT='JSON');

Thanks

Hi @robcam73 ,

You use the same Kafka topic for stream IMAGEN and stream LOGINS. When you consume a record with CREATE STREAM LOGINS ... the record is not deleted from topic imagen. Thus, you are adding Login records to the topic but the records that were there before are still there.

Try to use a different topic for CREATE STREAM LOGINS WITH ..., for example topic logins and verify that you only have Login records in topic logins.

Best,
Bruno

Hi

Yes, I see my error now. Thanks for your help

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