Repository navigation
Conversation
…5842) A flat_object was read to a fixed depth of 20; past it, the object that would have been descended into is kept as one leaf holding its JSON. The cap is now the dynamic setting plugins.query.flat_object.max_depth, defaulting to 20, the default of index.mapping.depth.limit. A pushed-down script flattens the field on the data node, where no query setting reaches it, so the value is held as a static that every node keeps in step with the cluster setting -- the pattern OpenSearch uses for indices.query.bool.max_clause_count. The engine's read and a script therefore apply the same cap. Resolves opensearch-project#5842 Signed-off-by: Jialiang Liang <jiallian@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (63.79%) is below the target coverage (99.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #5861 +/- ##
=========================================
Coverage 63.78% 63.79%
- Complexity 9063 9064 +1
=========================================
Files 962 962
Lines 40974 40982 +8
Branches 4653 4653
=========================================
+ Hits 26136 26144 +8
Misses 13962 13962
Partials 876 876
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
A flat_object was read to a fixed depth of 20 (
FlatObjectValues.MAX_DEPTH); past it, the object that would have been descended into is kept as one leaf holding its JSON. As requested on #5830, the cap is now a setting:plugins.query.flat_object.max_depth: node scope, dynamic, default 20 (the default ofindex.mapping.depth.limit), minimum 1.A pushed-down script flattens the field on the data node, where no query setting reaches it. So the value is held as a static in
FlatObjectValuesthat every node keeps in step with the cluster setting, written at startup and on each update inSQLPlugin.createComponents. This is the pattern OpenSearch'sSearchServiceuses forindices.query.bool.max_clause_count. The engine's read and a pushed-down script therefore apply the same cap.Testing
FlatObjectValuesTest: the cap moves both ways (30 reaches a 25-deep leaf, 3 cuts at 3).OpenSearchSettingsTest: default, dynamic, registered.CalciteFlatObjectIT(also inCalciteNoPushdownIT), over a 25-deep document added toflat_object.json: at the default, the leaf reads as null and a script filter on it finds nothing; raised to 30, both find it. With theSQLPluginhookup removed, the raised-depth case fails, so the IT covers the wiring.CalciteExplainITand the fullCalciteNoPushdownITpass (0 failures).Related Issues
Resolves #5842
Check List
--signoffor-s.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.