Add low_cardinality_enable field-level property for keyword/text fields#22405
Add low_cardinality_enable field-level property for keyword/text fields#22405cocosz wants to merge 2 commits into
Conversation
7d5a50b to
764b376
Compare
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit a8b8b7a.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
764b376 to
aaa60b0
Compare
PR Reviewer Guide 🔍(Review updated until commit 2963b34)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 2963b34 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 4e27ed6
Suggestions up to commit 1a94b08
Suggestions up to commit 1e1763e
Suggestions up to commit dbab29d
Suggestions up to commit aaa60b0
|
|
❌ Gradle check result for aaa60b0: 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? |
17b60e2 to
dbab29d
Compare
|
Persistent review updated to latest commit dbab29d |
|
Persistent review updated to latest commit 1e1763e |
|
❌ Gradle check result for 1e1763e: 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? |
1e1763e to
1a94b08
Compare
|
Persistent review updated to latest commit 1a94b08 |
|
Persistent review updated to latest commit 4e27ed6 |
Signed-off-by: Tanvir Alam <tanvralm@amazon.com>
4e27ed6 to
a8b8b7a
Compare
|
Persistent review updated to latest commit 2963b34 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #22405 +/- ##
============================================
- Coverage 73.48% 73.37% -0.11%
+ Complexity 76464 76326 -138
============================================
Files 6101 6101
Lines 346488 346512 +24
Branches 49871 49881 +10
============================================
- Hits 254620 254263 -357
- Misses 71599 71959 +360
- Partials 20269 20290 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Bukhtawar
left a comment
There was a problem hiding this comment.
The one thing I need to understand is what if the cardinality is very low like HTTP status codes, will low_cardinality be any significant value? It definitely is for high_cardinality but at the expense of low performance. How do we highlight this positiong?
Add
low_cardinality_enablefield-level property for parquet composite indicesDescription
Adds a new field-level index setting
low_cardinality_enablefor theparquet-data-formatsandbox plugin. When set totruefor akeywordortextfield on a parquet composite index, it automatically applies two optimizations at index creation time:index=false) — avoids write amplification and reduces index size for fields that will only be queried via Parquet bloom filters rather than Lucene term queries.This is designed for low-cardinality string fields (e.g.
status,region,event_type) in analytical parquet composite indices where exact-match filtering via bloom filters is the primary access pattern and the Lucene inverted index overhead is wasteful.Usage
This is equivalent to setting
"index": falseon those fields in the mapping plus enablingindex.parquet.bloom_filter_enabledfor the same fields — but expressed as a single declarative intent.Validation
All error paths enforced at index creation time via
ParquetIndexCreationValidator:keywordortextlow_cardinality_enable is only supported for keyword and text fieldsdoes not exist in mappingsdoes not use parquet data formatDuplicate field '...'must have the same size"yes")Must be true or falsevalue=falseTesting
Manually verified on a live OpenSearch 3.8.0-SNAPSHOT node with the full sandbox plugin stack (
composite-engine,parquet-data-format,analytics-backend-datafusion).Lucene index suppression
The
_field_capsAPI reportssearchable=falsefor fields withlow_cardinality_enable=true, confirming no inverted index is written. The result is identical to explicitly setting"index": falsein the field mapping:Parquet bloom filter
Inspected the written Parquet file for bloom filter. A bloom filter is present only for the
low_cardinality_enable=truefield, and absent for unaffected fields — identical behavior to usingindex.parquet.bloom_filter_enabled.field/valueexplicitly:Correctness cases (11 total)
keywordfields withvalue=truesearchable=false, bloom writtentextfield withvalue=truesearchable=false, bloom writtenvalue=false(explicit opt-out)low_cardinality_enablecoexists withbloom_filter_enabled+encoding_settingsAPIfieldandvaluearrays persisted correctlydouble,integer, …)"yes")