[Enhancement] Honor search.allow_expensive_queries when planning a script pushdown
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Trace the engine-wide script pushdown paths and check how the plugin reads search settings during planning; the issue names no source files or tests. Use the provided text-field reproduction with search.allow_expensive_queries=false as the first check, then cover the binary and flat_object cases mentioned in the issue. Done means script pushdowns are not emitted when the setting is false, or the rejection clearly identifies the setting and responsible query part.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What is wrong
A filter PPL cannot express as a DSL query is planned as a script query. OpenSearch already lets an operator refuse those with search.allow_expensive_queries (default true), but the plugin never consults it. When it is false the shard rejects the script and the user gets an error that names neither the setting nor the part of the query responsible:
java.sql.SQLException: exception while executing query: Failed to fetch data from the index:
the background task failed or interrupted.
Inner error: Failed to execute phase [query], all shards failed; shardFailures
{ ... QueryShardException[failed to create query: [script] queries cannot be executed
when 'search.allow_expensive_queries' is set to false.] }
A filter the index can answer succeeds in the same state, so the gate already discriminates correctly at the DSL level — the plugin just does not handle the rejection. allow_expensive_queries appears nowhere in the plugin.
Reproduce
A stock mapping: a text field with no keyword sub-field, so equality cannot become a term.
PUT /txtonly
{"settings":{"number_of_shards":1},
"mappings":{"properties":{"id":{"type":"keyword"},"msg":{"type":"text"}}}}
POST /txtonly/_doc/1?refresh=true
{"id":"a","msg":"hello world"}
PUT /_cluster/settings
{"transient":{"search.allow_expensive_queries":false}}
POST /_plugins/_ppl {"query": "source=txtonly | where msg = 'hello world' | fields id"}
| query | with the setting true |
with it false |
|---|---|---|
where msg = 'hello world' |
the row | the error above |
a filter the index can answer (where id = 'a') |
the row | the row |
Both engines reach it: the script pushdown is not Calcite-specific.
What it should do
Either of these; the first is preferable because the answer stays correct.
- Plan around it. When the setting is
false, do not emit a script pushdown — leave the predicate to the coordinator, which is what the engine already does for every other predicate it cannot push down. Slower, still correct. - Refuse clearly. Report that the query needs a script, name the setting, and say which part of the query caused it.
Scope
Engine-wide rather than specific to one field type: every script pushdown path is affected — a text field without a keyword sub-field as above, a binary field (#5757), and a field type with no doc values at all, such as the flat_object leaves added in #5830, where it was found.
- Lingua principale
- Java
- Stelle
- 175
- Fork
- 233
- Merge medio
- 2g 16h
- PR unite (30g)
- 39
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opensearch-project/sql
-
[Enhancement] Make the flat_object read depth cap configurable instead of a constantForse già presa @RyanL1997 l’ha presa 13 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
opensearch-project/sql#5842 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] PromQL queries fail with InvalidTypeIdException when metric has a label named "type"Forse già presa @nagendramohan l’ha presa 75 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
opensearch-project/sql#5684 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[DOC] Calcite settings documentation missing examplesForse già presa @AzazelSensei l’ha presa 32 giorni fa. Apertadocumentation PPL
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
opensearch-project/sql#4806 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement untriaged
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
opensearch-project/sql#5906 ·
I maintainer di solito rispondono entro 1 giorno
-
bug PPL untriaged
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
opensearch-project/sql#5904 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di opensearch-project/sql
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
521xueweihan/HelloGitHub#4105 ·
-
Awaiting further input from submitter
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Regression in 5.9.0: CuratorCache fails with ClassCastException when the client is not a CuratorFrameworkBaseForse già presa @sftwnd l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno