[Enhancement] Make the flat_object read depth cap configurable instead of a constant
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in FlatObjectValues.java where MAX_DEPTH is defined. Examine how plugin settings are declared in the project to choose between a cluster-wide plugin setting or reading the index's index.mapping.depth.limit. Update the constant to use the chosen configurable source, then add or update tests in the corresponding test class to verify the new behavior.
Written by the indexing model from the issue text.
Description
What is wrong
Reading a flat_object descends the document, not the mapping, so nothing upstream bounds the recursion — the depth comes from whatever was written. #5830 caps it with a constant:
// opensearch/src/main/java/org/opensearch/sql/opensearch/data/value/FlatObjectValues.java
static final int MAX_DEPTH = 20;
20 is the default of index.mapping.depth.limit, the depth a mapped object is allowed, so a flat_object is read as deeply as one. Nothing is dropped at the cap: the object that would have been descended into is kept as one leaf holding its own JSON.
A constant is the wrong shape for it. An index that raises index.mapping.depth.limit is still read to 20, and an operator who wants a tighter bound has no way to set one.
What it should do
Make the cap configurable, as requested on #5830. Two shapes worth weighing:
- a plugin setting, in the shape of the other
plugins.*limits, so it is one value for the cluster and dynamically updatable; - or read the target index's own
index.mapping.depth.limit, so a flat_object is read exactly as deep as a mapped object in the same index would be allowed — which is the reasoning the constant already stands on, just applied per index rather than at the default.
The second is the more faithful of the two; it needs the index setting to be available where the value is read, which the constant avoids today.
Follow-up to
#5830
- Dominant language
- Java
- Stars
- 175
- Forks
- 232
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 44
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opensearch-project/sql
-
[BUG] PromQL queries fail with InvalidTypeIdException when metric has a label named "type"Possibly taken @nagendramohan claimed this 66 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
opensearch-project/sql#5684 · 4 comments ·
Maintainers usually reply within 1 day
-
[DOC] Calcite settings documentation missing examplesPossibly taken @AzazelSensei claimed this 24 days ago. Opendocumentation PPL
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
opensearch-project/sql#4806 · 1 comment ·
Maintainers usually reply within 1 day
-
bug PPL untriaged
Difficulty 3/5 1-2 days Newbie friendliness 64/100
opensearch-project/sql#5887 ·
Maintainers usually reply within 1 day
-
bug PPL untriaged
Difficulty 3/5 1-2 days Newbie friendliness 45/100
opensearch-project/sql#5886 ·
Maintainers usually reply within 1 day
-
bug PPL untriaged
Difficulty 4/5 3-5 days Newbie friendliness 32/100
opensearch-project/sql#5885 ·
Maintainers usually reply within 1 day
All issues in opensearch-project/sql
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
scylladb/scylla-cdc-source-connector#350 ·
Maintainers usually reply within 1 day
-
agent:working documentation enhancement go:build lane:needs-decision
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Sanne/incus-spawn#1435 · 3 comments ·
Maintainers usually reply within 1 day
-
area:shuffle bug priority:high requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/datafusion-comet#7062 ·
Maintainers usually reply within 1 day
-
wait for review
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
enhancement good first issue up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
AnikethTS/ChangeRadar#22 ·
Maintainers usually reply within 1 day