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: Fix replacement of nested expressions in aggs with multiple parameters #104718

Merged
merged 5 commits into from Jan 25, 2024

Conversation

luigidellaquila
Copy link
Contributor

Fixes #104706

Fixing a small regression after #104387

The rule that extracts nested expressions from aggs did not take extra params into consideration, resulting in an IndexOutOfBoundsException for functions like percentile() that have more than one input parameter.

@elasticsearchmachine elasticsearchmachine added v8.13.0 Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Jan 24, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @luigidellaquila, I've created a changelog YAML for you.

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm.
Optionally, a count_distinct() test would be also welcome, as the only other agg with a parameter, but can stay as is too.

@luigidellaquila
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/part-3

@luigidellaquila
Copy link
Contributor Author

@bpintea good point, we have tests for count_distinct(), but not with nested expressions.
I added one.

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luigidellaquila luigidellaquila merged commit d1e5f72 into elastic:main Jan 25, 2024
15 checks passed
henningandersen pushed a commit to henningandersen/elasticsearch that referenced this pull request Jan 25, 2024
@luigidellaquila luigidellaquila deleted the esql/fix_104706 branch January 30, 2024 09:27
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.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ES|QL] Using expressions with MEDIAN or PERCENTILE results in index_out_of_bounds_exception
4 participants