Add Support for LIKE (LIST)#129170
Merged
julian-elastic merged 22 commits intoelastic:mainfrom Jun 17, 2025
Merged
Conversation
julian-elastic
commented
Jun 13, 2025
...sql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java
Outdated
Show resolved
Hide resolved
julian-elastic
commented
Jun 16, 2025
...n/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPatternList.java
Show resolved
Hide resolved
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Collaborator
|
Hi @julian-elastic, I've created a changelog YAML for you. |
nik9000
requested changes
Jun 16, 2025
Member
nik9000
left a comment
There was a problem hiding this comment.
Found a few small things to change. Looks good though.
.../main/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPattern.java
Outdated
Show resolved
Hide resolved
.../main/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPattern.java
Outdated
Show resolved
Hide resolved
...sql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java
Outdated
Show resolved
Hide resolved
...a/org/elasticsearch/xpack/esql/expression/function/scalar/string/regex/WildcardLikeList.java
Outdated
Show resolved
Hide resolved
...n/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPatternList.java
Outdated
Show resolved
Hide resolved
| */ | ||
| @Override | ||
| public String asJavaRegex() { | ||
| return patternList.stream().map(WildcardPattern::asJavaRegex).collect(Collectors.joining("|")); |
Member
There was a problem hiding this comment.
It looks like we never us Java's regex pattern with this - it's just a description string. In a follow up, can you rename this to, like description?
...n/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPatternList.java
Show resolved
Hide resolved
nik9000
approved these changes
Jun 16, 2025
Member
nik9000
left a comment
There was a problem hiding this comment.
Looks good to me. Left some minor comments you could take of leave.
...n/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPatternList.java
Outdated
Show resolved
Hide resolved
...n/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPatternList.java
Outdated
Show resolved
Hide resolved
...csearch/xpack/esql/optimizer/rules/logical/ReplaceStringCasingWithInsensitiveRegexMatch.java
Show resolved
Hide resolved
x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec
Outdated
Show resolved
Hide resolved
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
Contributor
Author
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
julian-elastic
added a commit
that referenced
this pull request
Jun 17, 2025
* Add Support for LIKE (LIST) (#129170) Adds support for LIKE function alternative syntax with a list of patterns. Examples: FROM foo | WHERE bar LIKE ("A*","B*", "C?") The new syntax is documented as part of the existing LIKE function documentation. We will use the existing WildcardLike java implementation for existing cases using the old syntax and one list argument case to improve mixed cluster compatibility.
julian-elastic
added a commit
that referenced
this pull request
Jul 1, 2025
Clarifies the version applicability for new LIKE function alternative syntax with a list of patterns, added in #129170
julian-elastic
added a commit
to julian-elastic/elasticsearch
that referenced
this pull request
Jul 1, 2025
Clarifies the version applicability for new LIKE function alternative syntax with a list of patterns, added in elastic#129170
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jul 1, 2025
mridula-s109
pushed a commit
to mridula-s109/elasticsearch
that referenced
this pull request
Jul 3, 2025
Clarifies the version applicability for new LIKE function alternative syntax with a list of patterns, added in elastic#129170
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for LIKE function alternative syntax with a list of patterns.
Examples:
The new syntax is documented as part of the existing LIKE function documentation. We will use the existing WildcardLike java implementation for existing cases using the old syntax and one list argument case to improve mixed cluster compatibility.