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

fix: 'drop (stream|table) if exists' fails if source does not exist #4872

Merged
merged 3 commits into from
Mar 25, 2020

Conversation

spena
Copy link
Member

@spena spena commented Mar 23, 2020

Description

What behavior do you want to change, why, how does your patch achieve the changes?
Fixes #4473

DROP STREAM <stream> should fail if does not exist.
DROP STREAM IF EXISTS <stream> should succeed if does not exist.

Testing done

Describe the testing strategy. Unit and integration tests are expected for any behavior changes.
Updated unit tests.
Verified manually

$ curl -X POST http://localhost:8088/ksql \
>      -H "Content-Type: application/vnd.ksql.v1+json; charset=utf-8" \
>      -d @<(cat <<EOF
> {
>   "ksql": "drop stream if exists test;",
>   "streamsProperties": {}
> }
> EOF
> )
[{"@type":"currentStatus","statementText":"drop stream if exists test;","commandId":"stream/TEST/drop","commandStatus":{"status":"SUCCESS","message":"Source `TEST` does not exist."},"commandSequenceNumber":3,"warnings":[]}]
$ curl -X POST http://localhost:8088/ksql \
>      -H "Content-Type: application/vnd.ksql.v1+json; charset=utf-8" \
>      -d @<(cat <<EOF
> {
>   "ksql": "drop stream test;",
>   "streamsProperties": {}
> }
> EOF
> )
{"@type":"statement_error","error_code":40001,"message":"Source TEST does not exist.","stackTrace":[],"statementText":"drop stream test;","entities":[]}

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@spena spena added the bug label Mar 23, 2020
@spena spena added this to the 0.9.0 milestone Mar 23, 2020
@spena spena requested review from rodesai and a team March 23, 2020 18:40
@spena spena force-pushed the fix_drop_if_exists branch from 8cfb1be to 5c14a4b Compare March 23, 2020 20:07
Copy link
Contributor

@big-andy-coates big-andy-coates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @spena

Is it possible to add a QTT test covering both the positive and negative test cases? Not sure if QTT will support them... I think you should be able to do the negative test case at least.

@spena spena force-pushed the fix_drop_if_exists branch 2 times, most recently from 232e50c to 04ab28c Compare March 24, 2020 18:39
@spena spena force-pushed the fix_drop_if_exists branch from 04ab28c to 6ccb9b0 Compare March 25, 2020 17:52
@spena spena merged commit b0669a0 into confluentinc:master Mar 25, 2020
@spena spena deleted the fix_drop_if_exists branch March 25, 2020 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DROP STREAM|TABLE IF EXISTS returns error code 40001 if stream does not exist
2 participants