Add support for updating JacksonEvent array elements#5772
Merged
graytaylor0 merged 5 commits intoJun 12, 2025
Conversation
Signed-off-by: Taylor Gray <tylgry@amazon.com>
Collaborator
|
@graytaylor0 looks good. Could you also add a test in |
Signed-off-by: Taylor Gray <tylgry@amazon.com>
kkondaka
reviewed
Jun 11, 2025
| int index = Integer.parseInt(key); | ||
| ArrayNode arrayNode = (ArrayNode) node; | ||
|
|
||
| while (arrayNode.size() <= index) { |
Collaborator
There was a problem hiding this comment.
Is there a test case for this?
Collaborator
There was a problem hiding this comment.
Also, I think we should limit the number new null nodes can be added.
san81
reviewed
Jun 11, 2025
Comment on lines
+202
to
+204
| while (arrayNode.size() <= index) { | ||
| arrayNode.addNull(); | ||
| } |
Collaborator
There was a problem hiding this comment.
Why do we have to fill nulls? You have null check in the below logic anyway right?
Collaborator
There was a problem hiding this comment.
We decided to not allow extending the size of array by filling nulls. We will allow at most one more entry beyond the current size
Signed-off-by: Taylor Gray <tylgry@amazon.com>
…end of the array Signed-off-by: Taylor Gray <tylgry@amazon.com>
kkondaka
reviewed
Jun 12, 2025
|
|
||
| while (arrayNode.size() <= index) { | ||
| int distanceFromArrayEnd = index - arrayNode.size(); | ||
| if (distanceFromArrayEnd >= FILL_OUT_OF_BOUNDS_ELEMENTS_LIMIT + 1) { |
Collaborator
There was a problem hiding this comment.
This condition can be outside the while loop
Signed-off-by: Taylor Gray <tylgry@amazon.com>
kkondaka
approved these changes
Jun 12, 2025
san81
approved these changes
Jun 12, 2025
jeffreyAaron
pushed a commit
to jeffreyAaron/data-prepper
that referenced
this pull request
Jun 13, 2025
…ect#5772) Signed-off-by: Taylor Gray <tylgry@amazon.com> Signed-off-by: Jeffrey Aaron Jeyasingh <jeffreyaaron06@gmail.com>
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.
Description
Fixes an issue where updating Jackson Event with json pointer paths to array like
failed with a ClassCastException to ObjectNode (since it is ArrayNode)
Issues Resolved
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.