Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CREATE OR REPLACE TABLE AS does not work #8104

Closed
Sullivan-Patrick opened this issue Sep 7, 2021 · 0 comments · Fixed by #8130
Closed

CREATE OR REPLACE TABLE AS does not work #8104

Sullivan-Patrick opened this issue Sep 7, 2021 · 0 comments · Fixed by #8130
Assignees
Labels
bug P0 Denotes must-have for a given milestone streaming-engine Tickets owned by the ksqlDB Streaming Team
Milestone

Comments

@Sullivan-Patrick
Copy link
Contributor

Sullivan-Patrick commented Sep 7, 2021

Describe the bug
CREATE OR REPLACE on an existing CTAS statement fails, giving the following error message:

Unable to initialize state, this can happen if multiple instances of Kafka Streams are running in the same state directory

This occurs on master and ksqlDB 0.20.0.

To Reproduce
-Issue a persistent query that creates a table
-Try to create or replace that table.

You can issue these statements exactly to reproduce:

CREATE TABLE tbl_cs (i INTEGER PRIMARY KEY, val STRING) WITH (kafka_topic='tbl', value_format='json',partitions=1);

CREATE TABLE tbl_csas AS SELECT * FROM tbl_cs EMIT CHANGES;

CREATE OR REPLACE TABLE tbl_csas AS SELECT * FROM tbl_cs EMIT CHANGES; --errors with: "Unable to initialize state, this can happen if multiple instances of Kafka Streams are running in the same state directory"

Expected behavior
The CREATE OR REPLACE statement executes successfully, using the old table's state store.

Actual behaviour
Unable to initialize state, this can happen if multiple instances of Kafka Streams are running in the same state directory occurs, the CREATE OR REPLACE is not executed and the table is not replaced.

@vcrfxia vcrfxia added streaming-engine Tickets owned by the ksqlDB Streaming Team P0 Denotes must-have for a given milestone labels Sep 7, 2021
@Sullivan-Patrick Sullivan-Patrick changed the title CREATE OR REPLACE does not work with tables CREATE OR REPLACE TABLE AS does not work Sep 7, 2021
@vcrfxia vcrfxia added this to the 0.23.0 milestone Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P0 Denotes must-have for a given milestone streaming-engine Tickets owned by the ksqlDB Streaming Team
Projects
None yet
3 participants