Skip to content

Conversation

@julian-elastic
Copy link
Contributor

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

Adds support for RLIKE function alternative syntax with a list of patterns.
Examples:

ROW message = "foobar"
| WHERE message RLIKE ("foo.*", "bar.")

The new syntax is documented as part of the existing RLIKE function documentation. We will use the existing RLike java implementation for existing cases using the old syntax and one list argument case to improve mixed cluster compatibility.
The RLikeList is pushed down as a single Automaton to improve performance.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 24, 2025

🔍 Preview links for changed docs:

🔔 The preview site may take up to 3 minutes to finish building. These links will become live once it completes.

@julian-elastic julian-elastic self-assigned this Jun 24, 2025
@julian-elastic julian-elastic added auto-backport Automatically create backport pull requests when merged >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Jun 24, 2025
@julian-elastic julian-elastic requested a review from nik9000 June 24, 2025 17:08
@julian-elastic julian-elastic marked this pull request as ready for review June 24, 2025 17:08
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label and removed Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Jun 24, 2025
@julian-elastic julian-elastic added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL labels Jun 24, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine removed the needs:triage Requires assignment of a team area label label Jun 24, 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.

LGTM

if (regexMatch.pattern() instanceof WildcardPatternList) {
// This optimization is not supported for WildcardPatternList for now
if (regexMatch.pattern() instanceof WildcardPatternList || regexMatch.pattern() instanceof RLikePatternList) {
// This optimization is not supported for WildcardPatternList and RLikePatternList for now
Copy link
Member

Choose a reason for hiding this comment

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

I suppose this is next in line!

@github-actions
Copy link
Contributor

github-actions bot commented Jul 14, 2025

🔍 Preview links for changed docs

@julian-elastic julian-elastic force-pushed the RLikeList_v4 branch 2 times, most recently from 89f035c to 2ffef9b Compare July 14, 2025 18:46
@julian-elastic julian-elastic marked this pull request as ready for review July 15, 2025 13:57
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.

LGTM

@julian-elastic julian-elastic merged commit f0c30f2 into elastic:main Jul 15, 2025
32 of 33 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

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

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

@julian-elastic
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.1

Questions ?

Please refer to the Backport tool documentation

julian-elastic added a commit to julian-elastic/elasticsearch that referenced this pull request Jul 15, 2025
Adds support for RLIKE function alternative syntax with a list of patterns.
Examples:

ROW message = "foobar"
| WHERE message RLIKE ("foo.*", "bar.")
The new syntax is documented as part of the existing RLIKE function documentation. We will use the existing RLike java implementation for existing cases using the old syntax and one list argument case to improve mixed cluster compatibility.
The RLikeList is pushed down as a single Automaton to improve performance.

(cherry picked from commit f0c30f2)

# Conflicts:
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java
julian-elastic added a commit to julian-elastic/elasticsearch that referenced this pull request Jul 15, 2025
Adds support for RLIKE function alternative syntax with a list of patterns.
Examples:

ROW message = "foobar"
| WHERE message RLIKE ("foo.*", "bar.")
The new syntax is documented as part of the existing RLIKE function documentation. We will use the existing RLike java implementation for existing cases using the old syntax and one list argument case to improve mixed cluster compatibility.
The RLikeList is pushed down as a single Automaton to improve performance.

(cherry picked from commit f0c30f2)

# Conflicts:
#	docs/reference/query-languages/esql/_snippets/operators/detailedDescription/rlike.md
#	x-pack/plugin/esql/src/main/antlr/parser/Expression.g4
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/regex/RLike.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java
@julian-elastic
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Questions ?

Please refer to the Backport tool documentation

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 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants