Skip to content

Added a flattened sink for unmapped fields at RootObjectMapper in columnar index modes#155007

Draft
Kubik42 wants to merge 1 commit into
elastic:mainfrom
Kubik42:flattened-root-pr-1
Draft

Added a flattened sink for unmapped fields at RootObjectMapper in columnar index modes#155007
Kubik42 wants to merge 1 commit into
elastic:mainfrom
Kubik42:flattened-root-pr-1

Conversation

@Kubik42

@Kubik42 Kubik42 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

This change is part of the work for https://github.com/elastic/logs-program/issues/149 and implements the beginning of https://github.com/elastic/logs-program/issues/54. What remains is the query, synthetic source, and block loader wiring.

Currently, all unmapped fields are matched with a corresponding FieldMapper (decided by us or via dynamic templates). The problem with this approach is that it creates a field explosion: for N unmapped fields, we create N fields in Lucene.

This PR addresses that by using a flattened field as a root-level sink for all unmapped fields. This works in unison with subobjects: false (disabled in strictly columnar index modes and not updateable), which flattens the paths to all leaves. All mapped fields are still parsed the same way.

Note, https://github.com/elastic/logs-program/issues/54 initially suggested to leverage the mapped sub-fields functionality of FlattenedFieldMapper, but I believe this is the better option; explanation.

/**
* Feature flag gating the implicit {@code _unmapped} sink that absorbs unmapped fields on strict columnar indices.
*/
public static final FeatureFlag UNMAPPED_FIELDS_FEATURE_FLAG = new FeatureFlag("flattened_unmapped_fields");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is gated behind a feature flag since I plan on splitting the work into multiple PRs for easier reviewing.

@Kubik42 Kubik42 changed the title Added a flattened sink for unmapped fields at RootObjectMapper Added a flattened sink for unmapped fields at RootObjectMapper for columnar index modes Jul 24, 2026
@Kubik42 Kubik42 changed the title Added a flattened sink for unmapped fields at RootObjectMapper for columnar index modes Added a flattened sink for unmapped fields at RootObjectMapper in columnar index modes Jul 24, 2026
@Kubik42
Kubik42 force-pushed the flattened-root-pr-1 branch from 26be504 to fe3290d Compare July 24, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants