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

ESQL: No rows with JOIN/ENRICH + EVAL + KEEP #120272

Open
Tracked by #116208
ivancea opened this issue Jan 16, 2025 · 2 comments · May be fixed by #120372
Open
Tracked by #116208

ESQL: No rows with JOIN/ENRICH + EVAL + KEEP #120272

ivancea opened this issue Jan 16, 2025 · 2 comments · May be fixed by #120372
Assignees
Labels
:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.18.0 v9.0.0

Comments

@ivancea
Copy link
Contributor

ivancea commented Jan 16, 2025

Weird interaction resulting in no rows:

Correct:

FROM languages
| DROP language_code
| EVAL language_code = 3
| LOOKUP JOIN languages_lookup ON language_code

# Results:
 language_code | language_name 
---------------+---------------
3              |Spanish
3              |Spanish
3              |Spanish
3              |Spanish

Wrong results:

FROM languages
| DROP language_code
| EVAL language_code = 3
| LOOKUP JOIN languages_lookup ON language_code
| KEEP language_code

# Results:
 language_code 
---------------

You can remove the first DROP if the original index doesn't have the JOIN key column

@ivancea ivancea added :Analytics/ES|QL AKA ESQL >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.18.0 v9.0.0 labels Jan 16, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@ivancea ivancea self-assigned this Jan 16, 2025
@ivancea
Copy link
Contributor Author

ivancea commented Jan 16, 2025

After some investigation, it's happening because of fieldNames() returning fields from the lookup to be searched through field-caps, which return no concrete indices for them.

The same is also happening with ENRICH, also in 8.17.

Also, chaining any of those commands may render a similar result: They will add "their own fields" to the field_caps

@ivancea ivancea changed the title ESQL: No rows with LOOKUP JOIN + EVAL + KEEP ESQL: No rows with JOIN/ENRICH + EVAL + KEEP Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants