Less jank in after-key parsing for unmapped fields (#86359)#97282
Merged
not-napoleon merged 5 commits intoelastic:7.17from Jul 3, 2023
Merged
Less jank in after-key parsing for unmapped fields (#86359)#97282not-napoleon merged 5 commits intoelastic:7.17from
not-napoleon merged 5 commits intoelastic:7.17from
Conversation
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.
Collaborator
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
Collaborator
|
Hi @not-napoleon, I've created a changelog YAML for you. |
martijnvg
approved these changes
Jul 3, 2023
Member
martijnvg
left a comment
There was a problem hiding this comment.
LGTM
This is a low risk change, so I think it is safe to backport.
| @@ -0,0 +1,6 @@ | |||
| pr: 97282 | |||
Member
There was a problem hiding this comment.
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?
Member
Author
|
bah, somehow I deleted both in github. So much for the web UI, I'll fix it on the CLI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.