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

refactor: change error type for "no statement" #11411

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

crepererum
Copy link
Contributor

Which issue does this PR close?

Amends #11394 (sorry, I should have reviewed that).

Rationale for this change

While reporting "not implemented" for "multiple statements" seems reasonable, I think the user should get a plan error (which roughly translates to "invalid argument") if they don't provide any statement. I don't see any reasonable way to support "no statement" ever, hence "not implemented" seems like a wrong promise.

What changes are included in this PR?

The user now gets a plan error instead of "no implemented" if no statement was provided.

Are these changes tested?

Adjusted existing test.

Are there any user-facing changes?

Improved error type. Esp. if the user converts that error type into a gRPG/HTTP error (e.g. IOx does this) then you can expect a more appropriate outcome.

@crepererum crepererum requested a review from alamb July 11, 2024 11:42
@github-actions github-actions bot added the core Core DataFusion crate label Jul 11, 2024
@crepererum crepererum changed the title refactor: change error type for "no plan" refactor: change error type for "no statement" Jul 11, 2024
@crepererum crepererum force-pushed the crepererum/amend_pr11394 branch from 1ea55ee to 1f2ced0 Compare July 11, 2024 11:45
Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

lgtm thanks @crepererum

Amends apache#11394 (sorry, I should have reviewed that).

While reporting "not implemented" for "multiple statements" seems
reasonable, I think the user should get a plan error (which roughly
translates to "invalid argument") if they don't provide any statement. I
don't see any reasonable way to support "no statement" ever, hence "not
implemented" seems like a wrong promise.
@crepererum crepererum force-pushed the crepererum/amend_pr11394 branch from 1f2ced0 to cbb1c9a Compare July 11, 2024 15:01
DataFusionError::NotImplemented(
"No SQL statements were provided in the query string".to_string(),
)
plan_datafusion_err!("No SQL statements were provided in the query string")
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@crepererum crepererum merged commit 6692382 into apache:main Jul 11, 2024
23 checks passed
@crepererum crepererum deleted the crepererum/amend_pr11394 branch July 11, 2024 16:17
Lordworms pushed a commit to Lordworms/arrow-datafusion that referenced this pull request Jul 12, 2024
Amends apache#11394 (sorry, I should have reviewed that).

While reporting "not implemented" for "multiple statements" seems
reasonable, I think the user should get a plan error (which roughly
translates to "invalid argument") if they don't provide any statement. I
don't see any reasonable way to support "no statement" ever, hence "not
implemented" seems like a wrong promise.
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
Amends apache#11394 (sorry, I should have reviewed that).

While reporting "not implemented" for "multiple statements" seems
reasonable, I think the user should get a plan error (which roughly
translates to "invalid argument") if they don't provide any statement. I
don't see any reasonable way to support "no statement" ever, hence "not
implemented" seems like a wrong promise.
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 17, 2024
Amends apache#11394 (sorry, I should have reviewed that).

While reporting "not implemented" for "multiple statements" seems
reasonable, I think the user should get a plan error (which roughly
translates to "invalid argument") if they don't provide any statement. I
don't see any reasonable way to support "no statement" ever, hence "not
implemented" seems like a wrong promise.
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 18, 2024
Amends apache#11394 (sorry, I should have reviewed that).

While reporting "not implemented" for "multiple statements" seems
reasonable, I think the user should get a plan error (which roughly
translates to "invalid argument") if they don't provide any statement. I
don't see any reasonable way to support "no statement" ever, hence "not
implemented" seems like a wrong promise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants