[Enhancement] Honor search.allow_expensive_queries when planning a script pushdown
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 175
- フォーク
- 233
- 平均マージ
- 3日 36分
- マージ済み PR(30日)
- 41
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opensearch-project/sql のほかの issue
-
[BUG] PromQL queries fail with InvalidTypeIdException when metric has a label named "type"対応中かも @nagendramohan が 85 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
opensearch-project/sql#5684 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
[DOC] Calcite settings documentation missing examples対応中かも @AzazelSensei が 43 日前に担当しました。 オープンdocumentation PPL
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
opensearch-project/sql#4806 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Testing] Test downstream plugins that load SQL classes (alerting, skills)対応中かも @ahkcs が 1 日前に担当しました。 オープンinfrastructure testing
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
opensearch-project/sql#5925 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Analytics routing does not resolve aliases and wildcard index expressions対応中かも @KarstenSchnitter が 6 日前に担当しました。 オープンanalytic-engine bug
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
opensearch-project/sql#5916 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
opensearch-project/sql#5911 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
opensearch-project/sql の issue をすべて見る
似ている issue
-
needs-area-label
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 2 日以内に返信
-
enhancement Java macOS
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
freerouting/freerouting#1079 ·
メンテナーはふだん 4 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/maven-enforcer#1074 ·
メンテナーはふだん 1 日以内に返信
-
Gradle liquibaseDiffChangelog drops jhi_date_time_wrapper対応中かも @mraible が今日担当しました。 オープンarea: triage theme: undefined
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
jhipster/generator-jhipster#35998 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openai/openai-java#1337 ·
メンテナーはふだん 1 日以内に返信