New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the map() returns wrong value #9002
Comments
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
here is a minimal example. the first two selects are fine, the last one should return zero rows but with extra create table data as from (
values
([0], [3]),
([0], [9])
) as t(l, r);
-- this works.
select r[1], map(l, r)[l[1]] as v from data where v[1] = r[1];
-- this works
select r[1], map(l, r)[l[1]] as v from data where v[1] != r[1];
-- this fails
select r[1], map(l, r)[l[1]] as v from data where v[1] != r[1] and r[1] > 5;
|
As always with issues like this:
Makes it work, so I'm going to have to have a look at the optimizers that affect this Hmm it's the reordering that causes it, but that means that |
i should've had a case without the the output in the map column, regardless of the where clause, is always what would appear in the first n rows without the where clause. eg: create table data as from (
values
([1], [3]),
([2], [9]),
([3], [15]),
([4], [21]),
) as t(l, r);
-- this works
select l[1], r[1], map(l, r) from data;
-- map output ignores where filter.
select l[1], r[1], map(l, r) from data where r[1] != 3;
-- map output ignores where filter.
select l[1], r[1], map(l, r) from data where r[1] != 9;
-- map output ignores where filter.
select l[1], r[1], map(l, r) from data where r[1] != 15;
|
Ah thanks, that's a good example |
What happens?
map(list1,list2)[item of list1] return empty or wrong value of list2
To Reproduce
see #8986
OS:
windows7 x64
DuckDB Version:
0.8.1
DuckDB Client:
CLI
Full Name:
lutao
Affiliation:
study
Have you tried this on the latest
main
branch?I have tested with a main build
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
The text was updated successfully, but these errors were encountered: