io.confluent.ksql.exception.KafkaTopicException: Topic 'KSQL_NOTIFY' does not conform to the requirements Partitions:1 v 4. Replication: 1 v 1
Why? Because the topic KSQL creates to underpin a CREATE STREAM AS SELECT
or CREATE TABLE AS SELECT
already exists, and doesn’t match what it expects. By default it will create partitions & replicas based on the same values of the input topic.
Options:
-
Use a different topic, via the
WITH (KAFKA_TOPIC='FOO')
syntax, e.g.CREATE STREAM TEST WITH (KAFKA_TOPIC='FOO') AS SELECT * FROM BAR;
-
Tell KSQL to use values that match the existing topic, with the
PARTITIONS
andREPLICAS
parameters. So if the existing topic only has one partition, then tell KSQL that’s what you want:CREATE STREAM TEST WITH (PARTITIONS=1) AS SELECT * FROM BAR;