Skip to content

Conversation

@manirajv06
Copy link
Contributor

…te in StrictMetricsEvaluator

Fixes #13765

@github-actions github-actions bot added the API label Aug 8, 2025
@manirajv06
Copy link
Contributor Author

@nastra @rdblue @kbendick Can you take a look?

@nastra
Copy link
Contributor

nastra commented Aug 8, 2025

@manirajv06 can you fix CI please?

@manirajv06
Copy link
Contributor Author

@manirajv06 can you fix CI please?

Fixed. Please check.

@manirajv06
Copy link
Contributor Author

@nastra @rdblue Had a chance to review the changes? Thanks.

Copy link
Contributor

@smaheshwar-pltr smaheshwar-pltr left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @manirajv06!

I'm not sure the logic is quite right as is - it seems to claim that if both the lower and upper bounds don't start with the prefix, then all rows don't start with the prefix.

However, consider notStartsWith("b") with bound ["a", "z"] - the logic above would report that all rows don't start with "b", but "b" could very well be a row lying between "a" and "z".

I think that the TODO here before was referring to the case where the prefix lies outside the bounds, in which case no row can match. There are similar semantics in the inclusive metric evaluation of the startsWith predicate, which I think it symmetric to this case:

public <T> Boolean startsWith(Bound<T> term, Literal<T> lit) {

@manirajv06
Copy link
Contributor Author

@smaheshwar-pltr Thanks for taking a look. Sorry for the delay.

My understanding is, Unlike Inclusive, Strict would answer only if it is able to find the values deterministically. Thats the reason for returning ROWS_MIGHT_NOT_MATCH in the initial cut as that would be more accurate from defensive stand point of view with the comment to catch the case that cannot match for sure later. I have made the changes to catch the cases that cannot match for sure using the prefix.

However, consider notStartsWith("b") with bound ["a", "z"] - the logic above would report that all rows don't start with "b", but "b" could very well be a row lying between "a" and "z".

Yes, this should return true in Inclusive, but should not be in Strict.

@rdblue Can you please check? Is my understanding correct?

@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 16, 2025
@manirajv06
Copy link
Contributor Author

recheck

@github-actions github-actions bot removed the stale label Oct 17, 2025
@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 16, 2025
@github-actions
Copy link

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle cases that definitely cannot match for notStartsWith() Predicate in StrictMetricsEvaluator

3 participants