Skip to content

ESQL: Renaming the grouping field before a stats still relies on the original field #105435

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

Closed
costin opened this issue Feb 13, 2024 · 3 comments
Closed
Assignees
Labels
:Analytics/ES|QL AKA ESQL >bug >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.1.0

Comments

@costin
Copy link
Member

costin commented Feb 13, 2024

Description

A potential bug in CombineProjections:
from employees | rename gender AS foo | stats bar = count(*) by foo | drop foo | sort bar - the stats still refers to the original field (gender) for grouping which is problematic as the field no longer exists in the child.
Related to #105433

@elasticsearchmachine
Copy link
Collaborator

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

@wchaparro
Copy link
Member

@fang-xing-esql still worth doing?

@fang-xing-esql
Copy link
Member

@fang-xing-esql still worth doing?

Thanks for the reminder @wchaparro ! It seems like this issue has been fixed, I tried this query below on the recent main, could be the side effects of the other bug fixes. I'll close this bug.

+ curl -u elastic:password -X POST 'localhost:9200/_query?format=txt&pretty' -H 'Content-Type: application/json' '-d
{
  "query": "from sample_data | rename client.ip AS foo | stats bar = count(*) by foo | drop foo | sort bar"

}
'
      bar      
---------------
1              
1              
1              
4 

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 >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.1.0
Projects
None yet
Development

No branches or pull requests

5 participants