Dynamic Mapping support for Pluggable Data Formats - #21444
Conversation
PR Reviewer Guide 🔍(Review updated until commit 120cd49)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to c1b964f Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 120cd49
Suggestions up to commit 0cc6f72
Suggestions up to commit 0cc6f72
Suggestions up to commit 0cc6f72
Suggestions up to commit 0cc6f72
|
|
❌ Gradle check result for bb21940: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
mgodwan
left a comment
There was a problem hiding this comment.
- Lets add concurrency tests.
- Can we enable dynamic mapping indexing tests which already exists for DFAE?
bb21940 to
be2a156
Compare
|
Persistent review updated to latest commit be2a156 |
|
❌ Gradle check result for be2a156: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
be2a156 to
4f80641
Compare
|
Persistent review updated to latest commit 4f80641 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #21444 +/- ##
============================================
- Coverage 73.49% 73.45% -0.04%
- Complexity 74624 74646 +22
============================================
Files 5980 5980
Lines 338825 338839 +14
Branches 48857 48860 +3
============================================
- Hits 249010 248890 -120
- Misses 70041 70111 +70
- Partials 19774 19838 +64 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4f80641 to
c066777
Compare
|
Persistent review updated to latest commit c066777 |
|
❌ Gradle check result for c066777: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
c066777 to
8b6c69d
Compare
|
Persistent review updated to latest commit 8b6c69d |
|
❌ Gradle check result for 8b6c69d: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
8b6c69d to
edb8baa
Compare
|
Persistent review updated to latest commit edb8baa |
|
❌ Gradle check result for edb8baa: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
edb8baa to
044ebd1
Compare
|
Persistent review updated to latest commit 044ebd1 |
|
❌ Gradle check result for 044ebd1: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
044ebd1 to
d48609e
Compare
|
Persistent review updated to latest commit d48609e |
d48609e to
2f05b57
Compare
|
Persistent review updated to latest commit 2f05b57 |
|
Persistent review updated to latest commit 0cc6f72 |
|
❌ Gradle check result for 0cc6f72: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 0cc6f72 |
|
❌ Gradle check result for 0cc6f72: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for 0cc6f72: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
0cc6f72 to
120cd49
Compare
|
Persistent review updated to latest commit 120cd49 |
|
❌ Gradle check result for 120cd49: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
120cd49 to
2fdf511
Compare
Signed-off-by: rayshrey <rayshrey@amazon.com>
Signed-off-by: rayshrey <rayshrey@amazon.com>
Signed-off-by: bharath-techie <bharath78910@gmail.com>
Signed-off-by: rayshrey <rayshrey@amazon.com>
2fdf511 to
c1b964f
Compare
|
❕ Gradle check result for c1b964f: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Description
Why dynamic mapping support is needed for pluggable formats
OpenSearch supports dynamic mapping — when a document contains a field not in the index mapping, the field is automatically added. This works transparently with Lucene because Lucene is inherently schema-on-write: each document can have any fields regardless of what previous documents had. There's no upfront schema declaration.
Parquet (and columnar formats in general) are fundamentally different. A Parquet file has a fixed schema declared at creation time. Every row in the file must conform to that schema. Once the native writer is initialized with a schema, it cannot accept rows with new columns. This means dynamic mapping — where new fields can appear at any time — requires explicit handling at
the engine level.
How it works at the DataFormatAwareEngine level
The engine maintains a pool of writers. Each writer tracks:
Normal indexing flow (no new fields):
When a new field arrives (dynamic mapping):
- If a mutable writer exists → it's selected (schema evolves dynamically inside)
- If only immutable writers exist with old versions → they're evicted from the available queue, a new writer is created with the fresh schema
This design is format-agnostic. Lucene writers are always mutable (isSchemaMutable = true), so they always pass the predicate and handle any document regardless of schema changes. The version tracking and eviction logic is invisible to Lucene — it just works.
How Parquet handles it
On the Parquet side, the key insight is that the native writer initialization (which locks the schema) must be deferred until we're certain the schema is complete.
Writer lifecycle:
- The batch is frozen (no more writes)
- The native writer is initialized with the frozen batch's schema (which includes all dynamically added fields)
- isSchemaMutable becomes false
- The batch is written to the native writer
Related Issues
#21587
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.