Skip to content

ES|QL: pruning of JOINs leads to missing fields #127467

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

Open
luigidellaquila opened this issue Apr 28, 2025 · 2 comments · May be fixed by #127687
Open

ES|QL: pruning of JOINs leads to missing fields #127467

luigidellaquila opened this issue Apr 28, 2025 · 2 comments · May be fixed by #127687
Labels
:Analytics/ES|QL AKA ESQL >bug medium-risk An open issue or test failure that is a medium risk to future releases Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@luigidellaquila
Copy link
Contributor

Probably related to #126017, but the symptoms are different:

With CSV dataset:

from books,message_*,ul* 
| enrich languages_policy on status 
| drop `language_name`, `bytes_out`, `id`, id 
| dissect book_no "%{type}" 
| dissect author.keyword "%{HZicfARaID}" 
| mv_expand `status` 
| sort HZicfARaID, year DESC NULLS LAST, publisher DESC NULLS FIRST, description DESC, type NULLS LAST, message ASC NULLS LAST, title NULLS FIRST, status NULLS LAST 
| enrich languages_policy on book_no 
| grok message "%{WORD:DiLNyZKNDu}" 
| limit 7972
| rename year as language_code 
| lookup join languages_lookup on language_code 
| limit 13966 
| stats  rcyIZnSOb = min(language_code), `ratings` = min(@timestamp), dgDxwMeFYrD = count(`@timestamp`), ifyZfXigqVN = count(*), qTXdrzSpY = min(language_code) by author.keyword
| rename author.keyword as message 
| lookup join message_types_lookup on message 
| stats  `ratings` = count(*) by type 
| stats  `type` = count(type), `ratings` = count(*) 
| keep `ratings`, ratings	
{
    "error": {
        "root_cause": [
            {
                "type": "verification_exception",
                "reason": "Found 1 problem\nline 1:832: Unknown column [type]"
            }
        ],
        "type": "verification_exception",
        "reason": "Found 1 problem\nline 1:832: Unknown column [type]"
    },
    "status": 400
}
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Apr 28, 2025
@luigidellaquila luigidellaquila added >bug :Analytics/ES|QL AKA ESQL and removed needs:triage Requires assignment of a team area label labels Apr 28, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 28, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@luigidellaquila luigidellaquila added the medium-risk An open issue or test failure that is a medium risk to future releases label Apr 28, 2025
@kanoshiou
Copy link
Contributor

Simplified query:

from message_types 
| dissect message "%{type}"
| stats message = max(message)  // or just use `drop type` to help us remove the `type` field
| lookup join message_types_lookup on message
| stats `ratings` = count(*) by type 
| keep ratings

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 medium-risk An open issue or test failure that is a medium risk to future releases Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants