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

ES|QL: Fix RLIKE folding with (unsupported) case insensitive pattern #118454

Merged
merged 4 commits into from
Dec 16, 2024

Conversation

luigidellaquila
Copy link
Contributor

RLIKE with (?i) prefix (case-insensitive) is not supported in ES|QL, but in a specific case (constant folding) the calculation relied on Java regex, that actually supports it, making the overall behavior inconsistent.

With this fix, (?i) prefix is not taken into consideration as a case-insensitive option.

Taking a chance to cleanup a bit the RegexMatch operator hierarchy.

Fixes: #118371

@luigidellaquila luigidellaquila added >bug auto-backport Automatically create backport pull requests when merged :Analytics/ES|QL AKA ESQL v8.18.0 labels Dec 11, 2024
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.0.0 labels Dec 11, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @luigidellaquila, I've created a changelog YAML for you.

@@ -93,6 +93,11 @@ protected TypeResolution resolveType() {
return isString(field(), sourceText(), DEFAULT);
}

@Override
public Boolean fold() {
return (Boolean) EvaluatorMapper.super.fold();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the actual fix, all the rest is refactoring and code cleanup

Copy link
Contributor

@ivancea ivancea left a comment

Choose a reason for hiding this comment

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

LGTM!

@luigidellaquila luigidellaquila enabled auto-merge (squash) December 16, 2024 12:34
@luigidellaquila luigidellaquila merged commit 2b8c494 into elastic:main Dec 16, 2024
16 checks passed
luigidellaquila added a commit to luigidellaquila/elasticsearch that referenced this pull request Dec 16, 2024
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

@nik9000
Copy link
Member

nik9000 commented Dec 26, 2024

I'm also backporting to 8.17.1: #119292

elasticsearchmachine pushed a commit that referenced this pull request Dec 26, 2024
…118454) (#118769) (#119292)

Co-authored-by: Luigi Dell'Aquila <luigi.dellaquila@gmail.com>
@luigidellaquila
Copy link
Contributor Author

Thanks @nik9000!

@nik9000
Copy link
Member

nik9000 commented Dec 27, 2024

Thanks @nik9000!

Happy to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.17.1 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ES|QL: inconsistent behavior with RLIKE and case insensitive regex syntax
4 participants