Open teichmaj opened 3 years ago
I tried to reproduce this issue using 0.14.0 docker image, and this are my observations: If I use the exact statement from above, the first statement fails already (what I kinda expected):
io.confluent.ksql.util.KsqlStatementException:
Statement is missing the 'VALUE_FORMAT' property from the WITH clause.
Either provide one or set a default via the 'ksql.persistence.default.format.value' config.
Btw: just adding a value_format
may or may not be sufficient, depending on the used format. If you integrate with Schema Registry, value_format
might be sufficient; otherwise, you would need to declare the schema of you stream explicitly.
Because the first statement cannot create the stream, the second statement fails of course, too.
If I change the first statement to
CREATE OR REPLACE STREAM `some_new_stream1` (field1 VARCHAR)
WITH (KAFKA_TOPIC = 'some.kafka.topic1', VALUE_FORMAT='json');
the stream is created and the second statement is also executed successfully.
Hi Matthias,
thank you for looking into this. We are using the Schema Registry and we are actually providing value_format='avro'
It's my bad that I forgot to include it in the example in the first comment.
The single statements work if we send them individually to the REST API of KSQL running in interactive mode. That's why we are fairly confident that the queries themselves are correct. In the logs we also do not see any exception for the first statement which creates the first stream over our existing kafka topic. The exception occurs when preparing the second statement as part of the same sql script.
Could it be that you hit https://github.com/confluentinc/ksql/issues/6725 -- can you try to set TRACE level logging?
Describe the bug We are running the ksqldb server in lockdown headless mode and provide the path to a
.sql
script via the environment variableKSQL_KSQL_QUERIES_FILE
The.sql
script contains two statements. The first statement defines a new stream on top of a Kafka topic which the second statement references. The second statement fails to validate because the stream defined in the first statement cannot be found. The problem sounds very similar to this: https://github.com/confluentinc/ksql/pull/3952To Reproduce KSQL version: 0.14.0
script.sql
content:Expected behavior Two new streams are created sequentially with the second stream consuming from the first stream.
Actual behaviour
Additional context The statements themselves are working fine when submitted individually one at the time to the ksqldb server in interactive mode via the API. The problem only occurs when trying to run the same statements but supply them to headless ksqldb server via a statement sql script.