[Fleet] Add support for additional types for dynamic mappings#168842
Merged
jsoriano merged 11 commits intoelastic:mainfrom Oct 17, 2023
Merged
[Fleet] Add support for additional types for dynamic mappings#168842jsoriano merged 11 commits intoelastic:mainfrom
jsoriano merged 11 commits intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Add support for fields that generate and dynamic mapping of the following types: - scaled_float - half_float - match_only_text - aggregate_metric_double - ip - integer (mapped as long as in other cases) - group (child fields are installed as dynamic mappings) When the type is not known, an error is raised now instead of silently ignoring the field definition.
6069a3e to
0855613
Compare
kpollich
approved these changes
Oct 13, 2023
Member
kpollich
left a comment
There was a problem hiding this comment.
Code + tests look good. Thanks for contributing this!
…into scaled-float-dynamic-mapping
…-ref HEAD~1..HEAD --fix'
mrodm
reviewed
Oct 16, 2023
| dynProperties.time_series_metric = field.metric_type; | ||
| matchingType = field.object_type_mapping_type ?? 'long'; | ||
| break; | ||
| case 'integer': |
Contributor
There was a problem hiding this comment.
Should it be added unsigned_long too ?
It is also an allowed object_type according to package-spec:
https://github.com/elastic/package-spec/blob/a4b0a7ff139c9b85e44602caeb83d93716c1f4d8/spec/integration/data_stream/fields/fields.spec.yml#L488
| dynProperties = histogram(field); | ||
| matchingType = field.object_type_mapping_type ?? '*'; | ||
| break; | ||
| case 'ip': |
Contributor
There was a problem hiding this comment.
There are some types that are not specified in the object_type field definition in package-spec: ip, wildcard, group or match_only_text
Should these be added too here?
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @jsoriano |
mrodm
approved these changes
Oct 16, 2023
dej611
pushed a commit
to dej611/kibana
that referenced
this pull request
Oct 17, 2023
…c#168842) Add support for fields that generate dynamic mappings of the following types: - match_only_text - scaled_float - aggregate_metric_double - half_float - ip - flattened - integer (mapped as long as in other cases) - group (child fields are installed as dynamic mappings) Default `match_matching_type` has been corrected to provide always a valid value. For example for floats it was using `float`, what is invalid, for this case it is changed to `double`. When the type is not known, an error is raised now instead of silently ignoring the field definition, this helps package developers discover earlier if their mappings are not well supported. Tested with the `install_all_packages` and no current package fails because of this. Fix elastic#168823
8 tasks
1 task
jsoriano
added a commit
that referenced
this pull request
Nov 6, 2023
) For `dynamic: "runtime"`, and possibly other configurations different to `dynamic: true`, intermediate objects need to exist for dynamic mappings, otherwise ingestion can fail with `Missing intermediate object` errors. This pull request includes these intermediate objects, and avoids the creation of static properties with wildcards, that is probably not what is expected for these mappings. Intermediate objects are included as static properties for parts of the name before the wildcard, and as dynamic templates when the full path has wildcards. In the modified test files are examples of all of these. This is more an issue since the following recent fixes, that create the actual dynamic mappings for some cases where only empty objects were created before. * elastic/elastic-package#1492 * #168842
Merged
2 tasks
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.
Summary
Add support for fields that generate dynamic mappings of the following types:
Default
match_matching_typehas been corrected to provide always a valid value. Forexample for floats it was using
float, what is invalid, for this case it is changed todouble.When the type is not known, an error is raised now instead of silently ignoring the field definition,
this helps package developers discover earlier if their mappings are not well supported.
Tested with the
install_all_packagesand no current package fails because of this.Fix #168823
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
install_all_packagesscript, and no current package fails because of this. Most cases catched earlier on Package Spec validation.