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

chore: handle error returned from resolve_data_source() #14076

Closed
wants to merge 4 commits into from

Conversation

xudong963
Copy link
Member

@xudong963 xudong963 commented Dec 19, 2023

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

handle error returned from resolve_data_source()

Fixes #14070

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - covered by current codebase

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe): improve error handling

This change is Reviewable

@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Dec 19, 2023
@xudong963 xudong963 marked this pull request as draft December 19, 2023 05:35
@xudong963 xudong963 force-pushed the error branch 4 times, most recently from 71e4876 to e7029e4 Compare December 20, 2023 01:09
@xudong963 xudong963 marked this pull request as ready for review December 20, 2023 01:54
Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r2, all commit messages.
Reviewable status: 1 of 3 files reviewed, 3 unresolved discussions (waiting on @BohuTANG, @lichuang, and @xudong963)


src/query/sharing/src/share_endpoint.rs line 150 at r2 (raw file):

                        share_name, e
                    ))),
                }

A json decoding error should be considered as internal error IMHO. UnknownXXX should be used only when an object does not exist, not when an object is damaged.


src/query/sql/src/planner/binder/table.rs line 263 at r2 (raw file):

                    parent = bind_context.parent.as_mut();
                }
                if e.code() == 1025 {

Use named const ErrorCode::UNKNOWN_TABLE instead of integer.

Does it need to deal with other causing errors such as UnknownDatabase? There are several other errors needs to be considered: WrongShareWrongShareObjectUnknownTableId

@xudong963
Copy link
Member Author

A json decoding error should be considered as internal error IMHO. UnknownXXX should be used only when an object does not exist, not when an object is damaged.

cc @lichuang, how about opening a new PR to process here?

@xudong963 xudong963 closed this Dec 20, 2023
@xudong963
Copy link
Member Author

@lichuang will open a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-chore this PR only has small changes that no need to record, like coding styles.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle error returned from resolve_data_source().
2 participants