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

DROP should have a flag to terminate dependent queries #1317

Closed
rmoff opened this issue May 17, 2018 · 3 comments
Closed

DROP should have a flag to terminate dependent queries #1317

rmoff opened this issue May 17, 2018 · 3 comments
Labels
code-lifecycle-ux Issues relating to the lifecycle of developing KSQL applications and deploying them to Production enhancement user-experience

Comments

@rmoff
Copy link
Contributor

rmoff commented May 17, 2018

In v5.0.0-SNAPSHOT, new behaviour when trying to drop a table that is being populated by a query:

ksql> CREATE TABLE PURCHASE_COUNT_BY_CITY_PER_30MIN AS SELECT city,COUNT(*) FROM Purchase_enriched WINDOW TUMBLING (SIZE 30 MINUTES) GROUP BY city;

 Message
---------------------------
 Table created and running
---------------------------

ksql> DROP TABLE PURCHASE_COUNT_BY_CITY_PER_30MIN;
Cannot drop the data source. The following queries read from this source: [] and the following queries write into this source: [CTAS_PURCHASE_COUNT_BY_CITY_PER_30MIN]. You need to terminate them before dropping this source.
ksql>

I understand the need for this protection, but for UX it would be really useful if we can have a flag to automatically do the required termination so that the object can be dropped. The common usecase will be a mistake in the DDL requiring a drop/recreate.

I would suggest something like DROP TABLE FOO CASCADE;

@rmoff rmoff changed the title DROP should have a flag to drop dependent queries DROP should have a flag to terminate dependent queries May 17, 2018
@rmoff
Copy link
Contributor Author

rmoff commented Jun 15, 2018

To be clear, the reason for adding something like CASCADE is to make the development experience nicer to users. If one is developing code and iterating on ideas, dropping & recreating objects is going to be common, and having to manually terminate the query each time literally doubles the effort.

@DW-Pete
Copy link

DW-Pete commented Aug 31, 2018

It is also a common use case to promote code using scripts and something like Jenkins; typically we may want to:

drop abc if exists;
create abc;

so that the topics, streams and tables being revised in a deployment are replaced cleanly. Active queries stop the run script and terminate in a KSQL script is not an option

@rmoff
Copy link
Contributor Author

rmoff commented Jan 9, 2019

Closing to track in #2177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-lifecycle-ux Issues relating to the lifecycle of developing KSQL applications and deploying them to Production enhancement user-experience
Projects
None yet
Development

No branches or pull requests

2 participants