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

Throw relevent error when query didn't match any selection rule #21904

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

uditvarshney
Copy link

@uditvarshney uditvarshney commented May 10, 2024

Description

The error message can be more significant which will help user to understand the query failure reason.

Fixes #21895

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`21895`)

@cla-bot cla-bot bot added the cla-signed label May 10, 2024
Copy link

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label May 31, 2024
@hashhar
Copy link
Member

hashhar commented May 31, 2024

Resource group can be applied to things other than users (e.g. query type or source) - the new error message would be wrong then.

@hashhar
Copy link
Member

hashhar commented May 31, 2024

@mosabua Can you suggest something better which is accurate yet more clear?

@@ -118,7 +118,7 @@ public void submit(ManagedQueryExecution queryExecution, SelectionContext<C> sel
public SelectionContext<C> selectGroup(SelectionCriteria criteria)
{
return configurationManager.get().match(criteria)
.orElseThrow(() -> new TrinoException(QUERY_REJECTED, "Query did not match any selection rule"));
.orElseThrow(() -> new TrinoException(QUERY_REJECTED, "User does not belong to any enabled resource group"));
Copy link
Member

Choose a reason for hiding this comment

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

Maybe

No matching resource group found with configured selection rules. No resources for query processing available.

Or only part of that even.

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.

[Trino-420] Relevant Error message should be shown when clientTags is not passed while query is run
3 participants