You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
Version
datafuselabs/databend-query:v1.2.540-nightly
What's Wrong?
When using Lateral values statement, some NULL values are still excluded from results. This is a follow-up from testing with fix for #15722
How to Reproduce?
droptable if exists rates;
createtablerates(origin varchar, dest varchar, distance int, "r2023"decimal(38,10), "r2022"decimal(38,10), "r2021"decimal(38,10));
insert into rates values ('a', 'b', 500, 2023.12, 2022.23, 2021.34);
insert into rates values ('a', 'c', 500, 2023.11, null, null);
-- futher nullsinsert into rates values ('a', 'd', 400, null, null, null);
insert into rates values ('a', 'e', null, null, null, null);
WITH source AS(
SELECT origin,
dest,
distance,
"r2023",
"r2022",
"r2021"FROM"rates"
)
SELECTr.origin, r.dest, r.rates, r.valuesFROM (
SELECTsource.origin,
source.dest,
v.rates,
v.valuesFROM source
JOIN LATERAL (
VALUES
(source."distance", 'distance'),
(source."r2023", 'r2023'),
(source."r2022", 'r2022'),
(source."r2021", 'r2021')
) AS v ("values", "rates") ON true
) AS r
Expected Results:
origin|dest|rates |values |
------+----+--------+-------+
a |b |distance| 500.0|
a |b |r2023 |2023.12|
a |b |r2022 |2022.23|
a |b |r2021 |2021.34|
a |c |distance| 500.0|
a |c |r2023 |2023.11|
a |c |r2022 | null|
a |c |r2021 | null|
a |d |distance| 400.0|
a |d |r2023 | null|
a |d |r2022 | null|
a |d |r2021 | null|
a |e |distance| null|
a |e |r2023 | null|
a |e |r2022 | null|
a |e |r2021 | null|
Actual Results:
origin|dest|rates |values |
------+----+--------+-------+
a |b |distance| 500.0|
a |b |r2023 |2023.12|
a |b |r2022 |2022.23|
a |b |r2021 |2021.34|
a |c |distance| 500.0|
a |c |r2023 |2023.11|
a |c |r2022 | null|
a |c |r2021 | null|
The text was updated successfully, but these errors were encountered:
Search before asking
Version
datafuselabs/databend-query:v1.2.540-nightly
What's Wrong?
When using Lateral values statement, some NULL values are still excluded from results. This is a follow-up from testing with fix for #15722
How to Reproduce?
Expected Results:
Actual Results:
The text was updated successfully, but these errors were encountered: