Relation literal rows are matched to columns by position, so rows with different field names or order produce wrong data
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 70/100
Hướng nghiên cứu
Start at prqlc/prqlc/src/semantic/lowering.rs L377-L414, where pl::ExprKind::Array is lowered into RelationLiteral.columns: columns come from the first row's lineage, and later rows' tuple values are copied in position, ignoring field names. First settle with the maintainers the open design question — reorder each row by name, or reject mismatched rows — plus the rule for unnamed fields like {1, 2}; coordinate with open PR #6413, which edits the same block. Done means from [{a=1, b=2}, {b=3, a=4}] compiles to SQL preserving names, and the other two example shapes either reorder or fail cleanly as decided.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A relation literal takes its column names from the first row only. Every later row is matched to those columns by position, ignoring its own field names. Queries whose rows disagree compile without error and produce wrong data.
from [{a=1, b=2}, {b=3, a=4}]
compiles (at c945ca81) to
WITH
table_0 AS (
SELECT
1 AS a,
2 AS b
UNION ALL
SELECT
3 AS a,
4 AS b
)
SELECT
a,
b
FROM
table_0
So the second row comes back as a=3, b=4 rather than a=4, b=3. Two related shapes go wrong the same way:
from [{a=1}, {b=2}]yields one columnawith values1, 2. The second row'sbis renamed toa.from [{a=1}, {a=2, b=3}]yields only columna. The second row'sb=3is dropped.
The lowering of pl::ExprKind::Array builds RelationLiteral.columns from the expression's lineage, then copies each row's tuple values in order without looking at their names (lowering.rs).
There are two plausible fixes: reorder each row's fields to match the first row's columns by name, or reject rows whose field names differ from the first row's with a compile error. Either way, unnamed fields ({1, 2}) need a rule too: whether they stay positional, and whether mixing named and unnamed fields is allowed. Open PR #6413 changes the same block (it reports malformed rows instead of panicking), so a fix here will probably build on it.
A review of #6413 first spotted this; it isn't caused by that PR.
- 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ự
-
github_actions security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
dekobon/big-code-analysis#1815 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: png-glitch bug P0 security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
chikoski/png-glitch#45 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
nekko-labs/nekko-agent#1756 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
yologdev/yoyo-evolve#1138 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gitbutlerapp/gitbutler#16982 ·
Maintainer thường phản hồi trong vòng 1 ngày