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

Remove "array" as field data type #412

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Sep 12, 2022

array doesn't correspond to any type available in Elasticsearch. Instead, Elasticsearch supports setting single or multiple values in the same fields. All values must be of the same type.

Current implementations in Beats and Fleet assume that object_type is set on these cases, and the type defined there is the one finally used in the index template. But there is nothing actually checking this, so we have packages using type: array without an object_type, what doesn't produce a valid mapping.

On the cases where object_type could be used, type alone can be used to produce the same result, so type: array with an object_type is redundant and leads to confusing results.

Stop allowing to define fields as arrays, as this doesn't produce what the package developer is probably expecting.

This change will be applied for packages starting on format version 2.0.0.

Closes #408.

Array doesn't correspond to any type available in Elasticsearch.
Instead, Elasticsearch supports setting single or multiple values in the
same fields. All values must be of the same type.

Stop allowing to define fields as arrays, as this doesn't produce what
the package developer is probably expecting.
@jsoriano
Copy link
Member Author

jsoriano commented Sep 12, 2022

Troubleshooting for package developers migrating added to v2 in elastic/elastic-package#974.

@jsoriano jsoriano self-assigned this Sep 12, 2022
@jsoriano jsoriano added the Team:Ecosystem Label for the Packages Ecosystem team label Sep 12, 2022
@elasticmachine
Copy link

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-09-12T15:11:21.445+0000

  • Duration: 8 min 36 sec

Test stats 🧪

Test Results
Failed 0
Passed 622
Skipped 0
Total 622

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (7/7) 💚
Files 70.833% (17/24) 👍
Classes 78.788% (26/33) 👍
Methods 58.824% (60/102) 👍
Lines 44.629% (536/1201) 👍
Conditionals 100.0% (0/0) 💚

@jsoriano jsoriano mentioned this pull request Sep 12, 2022
16 tasks
@jsoriano jsoriano merged commit c8a0fe0 into elastic:main Sep 13, 2022
@jsoriano jsoriano deleted the remove-array-field-type branch September 13, 2022 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Ecosystem Label for the Packages Ecosystem team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Change Proposal] Properly support or remove the array field type
3 participants