Handle BigInteger in xcontent copy#111937
Merged
elasticsearchmachine merged 12 commits intoelastic:mainfrom Aug 21, 2024
Merged
Handle BigInteger in xcontent copy#111937elasticsearchmachine merged 12 commits intoelastic:mainfrom
elasticsearchmachine merged 12 commits intoelastic:mainfrom
Conversation
When xcontent is copied, the parse tree is walked and each element is passed to the given generator. In the case of numbers, BigInteger and BigDecimal are not handled. This commit adds handling for those cases, and also ensures all token types are handled.
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Collaborator
|
Hi @rjernst, I've created a changelog YAML for you. |
…rch into xcontent/numeric_copy
mark-vieira
approved these changes
Aug 19, 2024
Member
Author
|
I've adjusted this PR to only add support for BigInteger, no longer BigDecimal. The only reason BigInteger is handled at all is that Elasticsearch has unsigned long fields which are not representable in Java's signed long type. |
ldematte
approved these changes
Aug 21, 2024
Contributor
ldematte
left a comment
There was a problem hiding this comment.
One little thing to fix, but LGTM
docs/changelog/111937.yaml
Outdated
| @@ -0,0 +1,5 @@ | |||
| pr: 111937 | |||
| summary: Handle `BigInteger` and `BigDecimal` in xcontent copy | |||
Contributor
There was a problem hiding this comment.
I think this needs to be adjusted too
cbuescher
pushed a commit
to cbuescher/elasticsearch
that referenced
this pull request
Sep 4, 2024
When xcontent is copied, the parse tree is walked and each element is passed to the given generator. In the case of numbers, BigInteger is currently not handled. Although arbitrary precision BigIntegers are not supported in Elasticsearch, they appear in xcontent when using unsigned long fields. This commit adds handling for that case, and also ensures all token types are handled. Note that BigDecimal are not supported at all since double is the largest floating point mapper supported. closes elastic#111812
davidkyle
pushed a commit
to davidkyle/elasticsearch
that referenced
this pull request
Sep 5, 2024
When xcontent is copied, the parse tree is walked and each element is passed to the given generator. In the case of numbers, BigInteger is currently not handled. Although arbitrary precision BigIntegers are not supported in Elasticsearch, they appear in xcontent when using unsigned long fields. This commit adds handling for that case, and also ensures all token types are handled. Note that BigDecimal are not supported at all since double is the largest floating point mapper supported. closes elastic#111812
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.
When xcontent is copied, the parse tree is walked and each element is passed to the given generator. In the case of numbers, BigInteger is currently not handled. Although arbitrary precision BigIntegers are not supported in Elasticsearch, they appear in xcontent when using unsigned long fields. This commit adds handling for that case, and also ensures all token types are handled. Note that BigDecimal are not supported at all since double is the largest floating point mapper supported.
closes #111812