Skip to content

Less jank in after-key parsing for unmapped fields (#86359)#97282

Merged
not-napoleon merged 5 commits intoelastic:7.17from
not-napoleon:backport-86359-to-7.17
Jul 3, 2023
Merged

Less jank in after-key parsing for unmapped fields (#86359)#97282
not-napoleon merged 5 commits intoelastic:7.17from
not-napoleon:backport-86359-to-7.17

Conversation

@not-napoleon
Copy link
Copy Markdown
Member

We had a request to backport this fix to 7.17. I'm not sure why I didn't do that when I wrote it a year ago, but I didn't see any problems with it today.

This addresses a bug where specifying an integer after key on an unmapped field for a terms composite source caused the shard to error.

Resolves #85928

The after-key parsing is pretty weird, and there are probably more bugs there. I did not take the opportunity to refactor the whole thing, but we should. This fixes the immediate problem by treating after keys as bytes refs when we don't have a field but think we want a keyword. We were already doing that if the user asked for a missing bucket, this just extends the behavior in the case that we don't.

Long term, the terms Composite source (and probably other Composite sources) should have specializations for unmapped fields. That's the direction we want to take aggs in general.

This addresses a bug where specifying an integer after key on an unmapped field for a terms composite source caused the shard to error.  

Resolves elastic#85928

The after-key parsing is pretty weird, and there are probably more bugs there. I did not take the opportunity to refactor the whole thing, but we should. This fixes the immediate problem by treating after keys as bytes refs when we don't have a field but think we want a keyword. We were already doing that if the user asked for a missing bucket, this just extends the behavior in the case that we don't.

Long term, the terms Composite source (and probably other Composite sources) should have specializations for unmapped fields. That's the direction we want to take aggs in general.
@elasticsearchmachine elasticsearchmachine added v7.17.12 needs:triage Requires assignment of a team area label labels Jun 30, 2023
@not-napoleon not-napoleon added >bug :Analytics/CompositeAggs and removed needs:triage Requires assignment of a team area label labels Jun 30, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jun 30, 2023
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @not-napoleon, I've created a changelog YAML for you.

Copy link
Copy Markdown
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
This is a low risk change, so I think it is safe to backport.

@@ -0,0 +1,6 @@
pr: 97282
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we keep one changelog?
I'm not sure whether we should keep this or the other.
Maybe because this backport is a while after the original change, let's keep this one?

@not-napoleon
Copy link
Copy Markdown
Member Author

bah, somehow I deleted both in github. So much for the web UI, I'll fix it on the CLI.

@not-napoleon not-napoleon merged commit 29ff32e into elastic:7.17 Jul 3, 2023
@not-napoleon not-napoleon deleted the backport-86359-to-7.17 branch July 3, 2023 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.17.12

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants