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

Add parsing error message field to TrinoQueryProperties #497

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

Chaho12
Copy link
Member

@Chaho12 Chaho12 commented Sep 30, 2024

Description

Add a field (private Optional ParseErrorMessage) to TrinoQueryProperties class that stores e.getMessage() when there is error.
https://github.com/trinodb/trino-gateway/blob/main/gateway-ha/src/main/java/io/trino/gateway/ha/router/TrinoQueryProperties.java#L213-L224

We have server connected with gateway that runs explain before actually running the query.
But not all queries need to be sent with explain.

For example there are cases where queries with parsing failure (no need to run explain cause it is highly likely to fail anyway due to syntax error)

  • we need to tell user on WHY query has failed, but running another sql parser or explain is waste of resource
  • since gateway already does query parsing, why not use that failure info.

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

Copy link
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

(x) Release notes are required, with the following suggested text:

  • Add parsing error message field to TrinoQueryProperties

Why do we need to mention this change in a release note?

@Chaho12
Copy link
Member Author

Chaho12 commented Sep 30, 2024

Why do we need to mention this change in a release note?

Thought there might be some people like me who would need the error info.
Not necessary though, docs is plenty.

@Chaho12 Chaho12 force-pushed the feature/add-parsing-error branch 2 times, most recently from e3ba5ed to 1e2e607 Compare October 2, 2024 13:41
@Chaho12 Chaho12 requested a review from ebyhr October 2, 2024 13:41
@Chaho12
Copy link
Member Author

Chaho12 commented Oct 2, 2024

@ebyhr Thanks for feedback. I think i've finished addressing your points. PTAL :)

@mosabua
Copy link
Member

mosabua commented Oct 3, 2024

Looks like @ebyhr and @Chaho12 are closing this out together shortly. Let me know if you want a review or other help from me.

@ebyhr ebyhr merged commit a45d249 into trinodb:main Oct 15, 2024
3 checks passed
@github-actions github-actions bot added this to the 12 milestone Oct 15, 2024
@Chaho12 Chaho12 deleted the feature/add-parsing-error branch October 16, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants