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

Fix cardinality agg for const_keyword #99814

Merged
merged 6 commits into from
Sep 25, 2023
Merged

Conversation

kkrik-es
Copy link
Contributor

const_keyword fields don't show up in the leafReader, since they have a const value. #92060 modified the logic to return no results in case the leaf reader contains no information about the requested field in a cardinality aggregation. This is wrong for const_keyword fields, as they contain up to 1 distinct value.

To fix this, we fall back to the old logic in this case that can handle const_keyword fields properly.

Fixes #99776

const_keyword fields don't show up in the leafReader, since they have
a const value. elastic#92060 modified the logic to return no results in case
the leaf reader contains no information about the requested field in a
cardinality aggregation. This is wrong for const_keyword fields, as they
contain up to 1 distinct value.

To fix this, we fall back to the old logic in this case that can
handle const_keyword fields properly.

Fixes elastic#99776
@kkrik-es kkrik-es added >bug :Analytics/Aggregations Aggregations Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Sep 22, 2023
@kkrik-es kkrik-es self-assigned this Sep 22, 2023
@elasticsearchmachine
Copy link
Collaborator

Hi @kkrik-es, I've created a changelog YAML for you.

@kkrik-es kkrik-es added the test-full-bwc Trigger full BWC version matrix tests label Sep 22, 2023
@kkrik-es kkrik-es requested a review from martijnvg September 22, 2023 14:29
@kkrik-es kkrik-es marked this pull request as ready for review September 22, 2023 14:29
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@kkrik-es kkrik-es added v8.9.3 auto-backport Automatically create backport pull requests when merged labels Sep 22, 2023
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM

@martijnvg
Copy link
Member

Since 8.10 has already been released there will be no more 8.9 releases. So no need to backport to the 8.9 branch.

@kkrik-es kkrik-es removed test-full-bwc Trigger full BWC version matrix tests v8.9.3 labels Sep 25, 2023
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.10

kkrik-es added a commit to kkrik-es/elasticsearch that referenced this pull request Sep 25, 2023
* Fix cardinality agg for const_keyword

const_keyword fields don't show up in the leafReader, since they have
a const value. elastic#92060 modified the logic to return no results in case
the leaf reader contains no information about the requested field in a
cardinality aggregation. This is wrong for const_keyword fields, as they
contain up to 1 distinct value.

To fix this, we fall back to the old logic in this case that can
handle const_keyword fields properly.

Fixes elastic#99776

* Update docs/changelog/99814.yaml

* Update skip ranges for broken releases.
elasticsearchmachine pushed a commit that referenced this pull request Sep 25, 2023
* Fix cardinality agg for const_keyword

const_keyword fields don't show up in the leafReader, since they have
a const value. #92060 modified the logic to return no results in case
the leaf reader contains no information about the requested field in a
cardinality aggregation. This is wrong for const_keyword fields, as they
contain up to 1 distinct value.

To fix this, we fall back to the old logic in this case that can
handle const_keyword fields properly.

Fixes #99776

* Update docs/changelog/99814.yaml

* Update skip ranges for broken releases.
@kkrik-es kkrik-es deleted the fix/99776 branch September 26, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations auto-backport Automatically create backport pull requests when merged >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.10.3 v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cardinality agg on constant_keyword fields returning zero in 8.9+
3 participants