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

ES|QL: Project optimized incorrectly due to missing references #108008

Open
luigidellaquila opened this issue Apr 29, 2024 · 2 comments · May be fixed by #108360
Open

ES|QL: Project optimized incorrectly due to missing references #108008

luigidellaquila opened this issue Apr 29, 2024 · 2 comments · May be fixed by #108360
Assignees
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

LogicalVerifier fails on the following query

row  a = "foo"  | stats  b = count(a), c = count(a) by a |  dissect a "%{b}"
{
    "error": {
        "root_cause": [
            {
                "type": "illegal_state_exception",
                "reason": "Found 1 problem\nline 1:19: Plan [Project[[b{r}#1055 AS c, a{r}#1052, b{r}#1060]]] optimized incorrectly due to missing references [b{r}#1055]"
            }
        ],
        "type": "illegal_state_exception",
        "reason": "Found 1 problem\nline 1:19: Plan [Project[[b{r}#1055 AS c, a{r}#1052, b{r}#1060]]] optimized incorrectly due to missing references [b{r}#1055]"
    },
    "status": 500
}

Interestingly, disabling the LogicalVerifier the query works fine.

@luigidellaquila luigidellaquila added >bug :Analytics/ES|QL AKA ESQL medium-risk An open issue or test failure that is a medium risk to future releases labels Apr 29, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 29, 2024
@alex-spies alex-spies self-assigned this Apr 29, 2024
@alex-spies
Copy link
Contributor

alex-spies commented Apr 29, 2024

Same problem with

from employees  | stats  b = count(first_name), c = count(first_name) by first_name | eval b = first_name

I suspect a problem with PushDownEval and PushDownRegexExtract.

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