Skip to content
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

[8.x] Compute output of LookupJoinExec dynamically (#117763) #117777

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

alex-spies
Copy link
Contributor

@alex-spies alex-spies commented Nov 29, 2024

Backport

This will backport the following commits from main to 8.x:

LookupJoinExec should not assume its output but instead compute it from
- Its input fields from the left - The fields added from the lookup
index

Currently, LookupJoinExec's output is determined when the logical plan
is mapped to a physical one, and thereafter the output cannot be changed
anymore. This makes it impossible to have late materialization of fields
from the left hand side via field extractions, because we are forced to
extract *all* fields before the LookupJoinExec, otherwise we do not
achieve the prescribed output.

Avoid that by tracking only which fields the LookupJoinExec will add
from the lookup index instead of tracking the whole output (that was
only correct for the logical plan).

**Note:** While this PR is a refactoring for the current functionality,
it should unblock @craigtaverner 's ongoing work related to field
extractions and getting multiple LOOKUP JOIN queries to work correctly
without adding hacks.

(cherry picked from commit 64107e0)

# Conflicts:
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlanner.java
@alex-spies alex-spies added >non-issue auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Analytics/ES|QL AKA ESQL v8.18.0 labels Nov 29, 2024
@elasticsearchmachine elasticsearchmachine merged commit 2eb635b into elastic:8.x Dec 2, 2024
15 checks passed
@alex-spies alex-spies deleted the backport/8.x/pr-117763 branch December 2, 2024 11:58
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-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >non-issue v8.18.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants