Skip to content
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

nulls in joined column when autopolars = True #1042

Open
rwickramatunga opened this issue Nov 25, 2024 · 1 comment
Open

nulls in joined column when autopolars = True #1042

rwickramatunga opened this issue Nov 25, 2024 · 1 comment

Comments

@rwickramatunga
Copy link

What happens?

id a
1 1
2 2
3 3

table_a

id b
1 1
2 2

table_b

SELECT 
*
FROM table_1
LEFT JOIN table_2
ON table_1.id = table_2.id

Returns

id a b
1 1 1
2 2 2
null 3 null

When it should return

id a b
1 1 1
2 2 2
3 3 null

To Reproduce

import duckdb
%load_ext sql
%sql duckdb:///:memory:
%config SqlMagic.autopolars = True
%%sql
CREATE TABLE table_a (
    id INTEGER,
    a INTEGER
);

INSERT INTO table_a (id, a) VALUES
(1, 1),
(2, 2),
(3, 3);

CREATE TABLE table_b (
    id INTEGER,
    b INTEGER
);

INSERT INTO table_b (id, b) VALUES
(1, 1),
(2, 2);
%%sql
SELECT 
    *
FROM 
    table_a
LEFT JOIN 
    table_b
ON 
    table_a.id = table_b.id;

OS:

Debian GNU/Linux 11 (bullseye)

JupySQL Version:

0.10.16

Full Name:

Rajith Wickramatunga

Affiliation:

camh

@rwickramatunga
Copy link
Author

rwickramatunga commented Nov 25, 2024

While I'm aware this is a solution sometimes there's just too many columns which would make the wildcard and correct auto-resolution of name conflicts preferable

SELECT 
    table_a.id AS id,
    a,
    b
FROM 
    table_a
LEFT JOIN 
    table_b
ON 
    table_a.id = table_b.id;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant