Reputation: 469
I am using KSQL for processing Kafka data. I can able to create persistent kafka streams, but the output topic for this stream is not compressed one. How can i define the compression type while creating the steream.
CREATE STREAM TARGET_TOPIC WITH **(COMPRESSION='SNAPPY')** AS SELECT * FROM SOURCE PARTITION BY ID
I am expecting giving compression configuration like above but the above syntax is not correct. If compression is possible in ksql please assist on this.
Thanks
Upvotes: 1
Views: 1013
Reputation: 1893
There are two ways to achieve this.
SET
command in KSQL to set the producer config that controls compression before creating the stream, e.g. SET 'compression.type'='snappy';
CREATE STREAM TARGET_TOPIC WITH **(COMPRESSION='SNAPPY')** AS SELECT * FROM SOURCE PARTITION BY ID
Upvotes: 2