`text.contains` underspecified: Text or pattern?
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 10.9k
- Fork
- 261
- Merge trung bình
- 3 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 84
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PRQL/prql
-
Underscore does not work as expectedCó thể đã có người làm @prql-bot đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PRQL/prql#6518 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
prqlc Debug Report HTML Does Not Escape Source File Name, Enabling Stored XSS via PRQLC_DEBUG_LOGĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
PRQL/prql#6502 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Add `.prql` to linguistĐang mởfriendliness integrations
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
PRQL/prql#1636 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 12/100
PRQL/prql#6517 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
review-runs-tracking: 2026-11Đang mởreview-runs-tracking
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 5/100
PRQL/prql#6513 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Issue tương tự
-
state:needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
zed-industries/zed#66543 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ruffle-rs/rust-flash-lso#142 ·
-
area: docs type: docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
light-curve/light-curve-python#870 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug file-compat priority: high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
storytold/photocraft#11330 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày