-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add Support for LIKE (LIST) #129170
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
Add Support for LIKE (LIST) #129170
Conversation
...sql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java
Outdated
Show resolved
Hide resolved
...n/java/org/elasticsearch/xpack/esql/core/expression/predicate/regex/WildcardPatternList.java
Show resolved
Hide resolved
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
Hi @julian-elastic, I've created a changelog YAML for you. |
nik9000
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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("|")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
💔 Backport failed
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
* 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.
Clarifies the version applicability for new LIKE function alternative syntax with a list of patterns, added in #129170
Clarifies the version applicability for new LIKE function alternative syntax with a list of patterns, added in elastic#129170
Clarifies the version applicability for new LIKE function alternative syntax with a list of patterns, added in elastic#129170
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.