`text.contains` underspecified: Text or pattern?
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
Start with the linked standard-library documentation for text functions and the issue's examples of generated SQL. Clarify whether contains, starts_with, and ends_with should accept patterns or literal text, then document the intended behavior; the issue does not name source files or tests. The issue is stale and discusses broader SQL-dialect design choices, so check for a maintainer decision before starting.
索引モデルが issue の本文から書いたものです。
説明
What's up?
The text substring search functions (contains, starts_with, ends_with) take a pattern rather than plain text, which may be surprising.
The documentation doesn't specify if it's a substring or a pattern.
Since it doesn't escape special characters, it is treated like a pattern, so wildcards pass through:
- Input:
filter (text.contains '%ne_dle' haystack) - Output:
AND haystack LIKE CONCAT('%', '%ne_dle', '%') - The current behavior uses
CONCATto surround the input with%, even if you give a literal. (Some SQL flavors don't allow three args toCONCAT, such as Oracle before 23, and Redshift.)
What's the intended behavior? It should be documented.
- If it's intended to be a pattern:
- For literals, it SHOULD just do
LIKE '%ne_dle%', right? This is a minor optimization.
- For literals, it SHOULD just do
- If it's meant to be plain text:
- Escape:
LIKE '%ne\_dle%' ESCAPE '\'- Transact-SQL: Special characters are
%_[]. - The escape character can be any symbol character which isn't in the string, or else it would need to double existing escape characters in the string.
- Transact-SQL: Special characters are
- Use
INSTR(haystack, 'ne_dle') > 0.- Microsoft's Transact:
CHARINDEXinstead ofINSTR. - For
starts_with, compare to= 1. - For
ends_with, this may be complicated.INSTR(haystack, 'ne_dle', -1)will search backwards, but the right value is dependent on the lengths of both strings:= LENGTH(haystack) - LENGTH('ne_dle') + 1- MySQL doesn't have three-arg
INSTR. Instead, it hasLOCATE, which can't search from the end of the string, so it will return the first position. SUBSTR(haystack, LENGTH(haystack) - LENGTH('ne_dle') + 1) = 'ne_dle', but may be inefficient by copying.REVERSEturnsends_withintostarts_with, but may be inefficient.
- Microsoft's Transact:
- Escape:
If it's supposed to be plain text, it may also be useful to give LIKE as an alternative, such as a text.like function (#1123). I don't know what the project's principle is for handling differences in LIKE syntax.
- 主要言語
- Rust
- スター
- 10.9k
- フォーク
- 261
- 平均マージ
- 3日 21時間
- マージ済み PR(30日)
- 84
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PRQL/prql のほかの issue
-
Underscore does not work as expected対応中かも @prql-bot が 4 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
prqlc Debug Report HTML Does Not Escape Source File Name, Enabling Stored XSS via PRQLC_DEBUG_LOGオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 3 日以内に返信
-
friendliness integrations
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
PRQL/prql#1636 · コメント 2 件 · リアクション 2 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 12/100
メンテナーはふだん 3 日以内に返信
-
review-runs-tracking
難易度 3/5 半日 初心者へのやさしさ 5/100
メンテナーはふだん 3 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
ScoopInstaller/Extras#19275 ·
メンテナーはふだん 1 日以内に返信
-
area:plugins kind:bug priority:p2 ready
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug priority: medium ui
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
storytold/gridcraft#3496 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bip39: Mnemonic::new_from_phrase rejects phrases with extra or non-space whitespace対応中かも @chukwudiikeh が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信