Skip to content

Conversation

@julian-elastic
Copy link
Contributor

@julian-elastic julian-elastic commented Jun 10, 2025

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 julian-elastic changed the title New Func Added [WIP] Add Support for IN LIKE Jun 10, 2025
@julian-elastic julian-elastic changed the title [WIP] Add Support for IN LIKE [WIP] Add Support for LIKE (LIST) Jun 11, 2025
@julian-elastic julian-elastic marked this pull request as ready for review June 16, 2025 14:45
@julian-elastic julian-elastic requested a review from nik9000 June 16, 2025 14:45
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jun 16, 2025
@julian-elastic julian-elastic self-assigned this Jun 16, 2025
@julian-elastic julian-elastic changed the title [WIP] Add Support for LIKE (LIST) Add Support for LIKE (LIST) Jun 16, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @julian-elastic, I've created a changelog YAML for you.

Copy link
Member

@nik9000 nik9000 left a 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.

*/
@Override
public String asJavaRegex() {
return patternList.stream().map(WildcardPattern::asJavaRegex).collect(Collectors.joining("|"));
Copy link
Member

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?

@nik9000 nik9000 added auto-backport Automatically create backport pull requests when merged v8.19.0 labels Jun 16, 2025
Copy link
Member

@nik9000 nik9000 left a 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.

@julian-elastic julian-elastic enabled auto-merge (squash) June 17, 2025 01:19
@julian-elastic julian-elastic merged commit 7fb130c into elastic:main Jun 17, 2025
23 of 25 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 129170

@julian-elastic
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

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
Clarifies the version applicability for new LIKE function alternative syntax with a list of patterns, added in #129170
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
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 backport pending >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants