Skip to content

Conversation

jinyangli34
Copy link
Contributor

Description

Add support for resource group selector pattern matching on client tags

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}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Aug 1, 2025
Copy link
Contributor

@chenjian2664 chenjian2664 left a comment

Choose a reason for hiding this comment

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

Should we have some necessary documents changes ?

@@ -90,8 +91,12 @@ public StaticSelector(
new BasicMatcher(criteria -> queryTypeValue.equalsIgnoreCase(criteria.getQueryType().orElse("")))))
.add(selectorResourceEstimate.map(selectorResourceEstimateValue ->
new BasicMatcher(criteria -> selectorResourceEstimateValue.match(criteria.getResourceEstimates()))))
.add(clientTags.map(clientTagsValue ->
new BasicMatcher(criteria -> criteria.getTags().containsAll(clientTagsValue))))
.add(clientTags.map(tags -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a breaking change if users previously used client tags containing special characters (like *) that are interpreted in regex

@@ -212,6 +212,46 @@ public void testClientTags()
assertThat(selector.match(newSelectionCriteria("A.user", "a source b", ImmutableSet.of("tag1", "tag2", "tag3"), EMPTY_RESOURCE_ESTIMATES)).map(SelectionContext::getResourceGroupId)).isEqualTo(Optional.of(resourceGroupId));
}

@Test
public void testClientTagsRegex()
Copy link
Contributor

Choose a reason for hiding this comment

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

package private

@jinyangli34 jinyangli34 force-pushed the jinyang-client_tags_pattern branch from 1b96843 to c3cf480 Compare August 4, 2025 16:29
@jinyangli34 jinyangli34 force-pushed the jinyang-client_tags_pattern branch from c3cf480 to 9c43cc0 Compare August 4, 2025 21:31
Copy link

This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack.

@github-actions github-actions bot added the stale label Aug 26, 2025
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.

2 participants