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

[BUG] Field Name Incorrectly Popped from Path in flat_object During Array Processing #13351

Closed
naomichi-y opened this issue Apr 23, 2024 · 1 comment
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing v2.17.0 v3.0.0 Issues and PRs related to version 3.0.0

Comments

@naomichi-y
Copy link
Contributor

naomichi-y commented Apr 23, 2024

Describe the bug

In the flat_object function, which is responsible for converting nested JSON data into a flattened format, there is an issue related to handling JSON arrays containing multiple objects.
Specifically, the function incorrectly removes the array field name from the path after processing the first object within the array. As a result, when processing subsequent objects in the same array, the flattened key-path lacks the correct array field name, leading to inaccurate representation of the data structure.

Related component

Indexing

To Reproduce

Here is the test code to reproduce the issue.
#13259 (comment)

Expected behavior

The expected behavior of the test code is to correctly flatten the nested JSON structure into a simple, flat format without losing any structural context due to array processing.

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context

This issue can be reproduced in OpenSearch 2.12.

@naomichi-y naomichi-y added bug Something isn't working untriaged labels Apr 23, 2024
@github-actions github-actions bot added the Indexing Indexing, Bulk Indexing and anything related to indexing label Apr 23, 2024
@peternied
Copy link
Member

[Triage - attendees 1 2 3 4 5 6]
@naomichi-y Thanks for creating this issue, please consider submitting a pull request to address this issue.

@reta reta added v3.0.0 Issues and PRs related to version 3.0.0 v2.17.0 labels Aug 13, 2024
@reta reta closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing v2.17.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

No branches or pull requests

3 participants