-
Notifications
You must be signed in to change notification settings - Fork 753
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
refactor: refactor error message return for drop table and set options #14078
Conversation
997e64b
to
fc868fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @dantengsky and @JackTan25)
src/query/service/src/interpreters/interpreter_table_drop.rs
line 61 at r1 (raw file):
Err(error) => { // UnknownTable Code if error.code() == 1025 {
Do not use integer literal, use a named const or something people understand
src/query/service/src/interpreters/interpreter_table_set_options.rs
Outdated
Show resolved
Hide resolved
…tabend into remove_old_bad_code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 4 files at r4, all commit messages.
Reviewable status: 2 of 8 files reviewed, 5 unresolved discussions (waiting on @dantengsky, @JackTan25, and @ZhiHanZ)
src/query/service/src/interpreters/interpreter_table_drop.rs
line 62 at r4 (raw file):
if (error.code() == ErrorCode::UNKNOWN_TABLE || error.code() == ErrorCode::UNKNOWN_CATALOG || error.code() == ErrorCode::UNKNOWN_DATABASE)
get_table()
also returns business errors such as: WrongShare
, WrongShareObject
, UnknownTableId
. These errors should be caught too.
https://github.com/datafuselabs/databend/blob/188426e3e67cc57b2d3f70b7da34c0eb198836bf/src/meta/api/src/schema_api_impl.rs#L4119
https://github.com/datafuselabs/databend/blob/188426e3e67cc57b2d3f70b7da34c0eb198836bf/src/meta/api/src/schema_api_impl.rs#L4135
https://github.com/datafuselabs/databend/blob/188426e3e67cc57b2d3f70b7da34c0eb198836bf/src/meta/api/src/util.rs#L778
I see. What should I be concerned about? 🤔 |
I just express that we can return the error to fronted end. |
You caught these 3 errors:
But Why do you have to deal with UNKNOWN_TABLE, UNKNOWN_CATALOG and UNKNOWN_DATABASE but do not deal with the former three? |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
There are bad code written by before unexpectedly. We should process the error correctly. For alter option and drop table, when they can't get table, if the error is not unknown table, we should return the true error message,
Fixes #[Link the issue here]
#14072 #14071
Tests
Type of change
This change is