What happened?
Context: support for relations created by from_text that have zero rows was added in #4693 and discussed in #4421.
The PRQL below crashes on compilation with:
Message: called `Option::unwrap()` on a `None` value
Location: prqlc/prqlc/src/semantic/resolver/transforms.rs:579
PRQL input
from foo
select {bar}
join side:left map = (
from_text format:json '{"columns":["key","value"],"data":[]}'
) this.bar == that.key
SQL output
Expected SQL output
WITH table_0 AS (
SELECT
NULL AS "key",
NULL AS value
WHERE
false
)
SELECT
foo.bar,
table_0."key",
table_0.value
FROM
foo
LEFT OUTER JOIN table_0 ON foo.bar = table_0."key"
MVCE confirmation
Anything else?
The analogous PRQL code with more than one row does compile successfully:
from foo
select {bar}
join side:left map = (
from_text format:json '{"columns":["key","value"],"data":[["x","y"]]}'
) this.bar == that.key
What happened?
Context: support for relations created by
from_textthat have zero rows was added in #4693 and discussed in #4421.The PRQL below crashes on compilation with:
PRQL input
SQL output
N/AExpected SQL output
MVCE confirmation
Anything else?
The analogous PRQL code with more than one row does compile successfully: