Skip to content

Conversation

@julian-elastic
Copy link
Contributor

@julian-elastic julian-elastic commented Oct 7, 2025

• Added Full Text Functions Support in Lookup Join Expressions: Extended lookup join functionality to support full-text functions like MATCH() as part of join conditions, enabling text search capabilities within lookup operations.
• Enhanced Lucene Pushable Filters Support. Implemented support for any Lucene pushable filters that contain only fields from the right side of the lookup join, allowing for more complex filtering conditions. At least one condition relating the left and right side of the Lookup Join is still required.

Full text function

FROM left_table
| LOOKUP JOIN right_table ON left_id == right_id AND MATCH(right_field, "search_term")

OR of Lucene pushable filters on fields from the lookup index

FROM left_table
| LOOKUP JOIN right_table ON left_id == right_id AND (right_field like "*pattern" OR right_value > 1000)

OR and NOT of Lucene pushable filters on fields from the lookup index

FROM left_table
| LOOKUP JOIN right_table ON (MATCH(right_field, "search_term") AND right_value < 5000 OR NOT (right_field != "exclude1" AND right_field != "exclude2")) AND left_id == right_id

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.3.0 labels Oct 7, 2025
@julian-elastic julian-elastic self-assigned this Oct 7, 2025
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) and removed needs:triage Requires assignment of a team area label labels Oct 7, 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)

Copy link
Member

@carlosdelest carlosdelest left a comment

Choose a reason for hiding this comment

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

LGTM from the full text functions perspective 👍 :

  • Changes imply adding checks for lookup join conditions
  • IT tests have been updated with relevant tests

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

First round of comments: analysis

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

I have a question on the modeling of right-only filters, see below.

@julian-elastic julian-elastic changed the title ESQL: Add support for Full Text Functions for Lookup Join ESQL: Add support for Full Text Functions and Lucene Pushable Predicates for Lookup Join Oct 16, 2025
Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

Productive code reviewed and looking mighty good!

Wrapping up the tests as well. Found some things that we need to have a look at there, but nothing that'll block this for long.

I think we'll want to add the new expression joins to our generative tests, no?

Also, this generally allows all Lucene-pushable filters to be put into the ON condition. Some expressions might not consider this correct and will require an update of, say, the validation (as for full text functions). Maybe we should consider a randomized test that generates a pushable expression that we then stuff into the join condition? (We can compare the result by just running the WHERE filter on the lookup index in a separate query.)

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

Ok, all done now. This still looks very good. I found another oopsie re. the capabilities used which we should fix, but in total I think we can merge after the next iteration, most likely. Nice!

@julian-elastic
Copy link
Contributor Author

@vadimkibana @stratoula This PR is not making any changes to the antler grammar, but it does allow for more complex expressions as part of the lookup join on condition. Do you need any changes on your side for this? Please have this in mind when working on elastic/kibana#236939

@stratoula
Copy link

Thanx @julian-elastic noted!

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

This is great, thanks @julian-elastic !


FROM airports
| RENAME abbrev AS airport_code
| LOOKUP JOIN airport_city_boundaries ON airport_code == abbrev AND ST_CONTAINS(TO_GEOSHAPE("POLYGON((-0.3 51.0, -0.1 51.0, -0.1 51.2, -0.3 51.2, -0.3 51.0))"), city_boundary)
Copy link
Contributor

Choose a reason for hiding this comment

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

@craigtaverner , you may want to see this :) woohoo

@julian-elastic julian-elastic merged commit d213909 into elastic:main Oct 23, 2025
34 checks passed
fzowl pushed a commit to voyage-ai/elasticsearch that referenced this pull request Nov 3, 2025
…tes for Lookup Join (elastic#136104)

• Added Full Text Functions Support in Lookup Join Expressions: Extended lookup join functionality to support full-text functions like MATCH() as part of join conditions, enabling text search capabilities within lookup operations.
• Enhanced Lucene Pushable Filters Support. Implemented support for any Lucene pushable filters that contain only fields from the right side of the lookup join, allowing for more complex filtering conditions. At least one condition relating the left and right side of the Lookup Join is still required.

This commit may include content that was generated or assisted by GenAI tools Cursor, Gemini CLI and/or Github Copilot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants