Relation literal rows are matched to columns by position, so rows with different field names or order produce wrong data
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 70/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 10.9k
- Forks
- 261
- Merge medio
- 3 d 21 h
- PR fusionados (30 d)
- 84
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PRQL/prql
-
Underscore does not work as expectedPosiblemente ocupada @prql-bot la tomó hace 4 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PRQL/prql#6518 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
prqlc Debug Report HTML Does Not Escape Source File Name, Enabling Stored XSS via PRQLC_DEBUG_LOGAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
PRQL/prql#6502 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Add `.prql` to linguistAbiertofriendliness integrations
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
PRQL/prql#1636 · 2 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 3 días
-
Dificultad 4/5 1-2 días Aptitud para principiantes 12/100
PRQL/prql#6517 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
review-runs-tracking: 2026-11Abiertoreview-runs-tracking
Dificultad 3/5 Medio día Aptitud para principiantes 5/100
PRQL/prql#6513 · 1 comentario ·
Los mantenedores suelen responder en 3 días
Issues similares
-
bug i18n priority: medium ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
storytold/craft-anything#983 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`swf` upgrade to 0.4.0Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Dinnerbone/Rascal#91 · 2 reacciones ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
higress-group/HiRoute#405 ·
Los mantenedores suelen responder en 1 día
-
rust_analyzer flycheck: no CLI way to enable clippy from `check.overrideCommand`Posiblemente ocupada @TrapsterDK la tomó hoy. Abiertoneeds-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
bazelbuild/rules_rust#4392 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día