heavyai / heavydb

HeavyDB (formerly OmniSciDB)
https://heavy.ai
Apache License 2.0
2.96k stars 448 forks source link

[GPU Error Bug] SELECT * FROM <table> JOIN ( SELECT ALL <number> FROM <table>) AS <alias> Brings Errors #816

Open qwebug opened 1 year ago

qwebug commented 1 year ago

Describe:

Using SELECT * FROM \

JOIN ( SELECT ALL \ FROM \
) AS \  brings different results , when set EXECUTOR_DEVICE 'CPU' and 'GPU'.

SQL:

CREATE TABLE t1(c0 integer NOT NULL, c2 TEXT);
ALTER SESSION SET EXECUTOR_DEVICE='CPU';
SELECT * FROM t1 JOIN (SELECT ALL 0.42445757423087693 FROM t1) AS sub0 ON true WHERE NOT (t1.c2) NOT IN (t1.c2, t1.c2);

Result:

No rows returned.

SQL:

ALTER SESSION SET EXECUTOR_DEVICE='GPU';
SELECT * FROM t1 JOIN (SELECT ALL 0.42445757423087693 FROM t1) AS sub0 ON true WHERE NOT (t1.c2) NOT IN (t1.c2, t1.c2);

Result:

Query execution failed because the query contains not supported self-join pattern. We suspect the query requires multiple left-deep join tree due to the join condition of the self-join and is not supported for now. Please consider chaning the table order in the FROM clause.

Environment:

Docker Deployment

https://hub.docker.com/layers/heavyai/heavyai-ee-cuda/latest/images/sha256-5af3ad3a00cbc5ce09c299b8b81cda96521a27373dbb1e59209c02358cfd9b1f?context=explore

Docker DIGEST: sha256:5af3ad3a00cbc5ce09c299b8b81cda96521a27373dbb1e59209c02358cfd9b1f

HeavyDB Version: 7.1.0-20230821-eae9ec17da

HeavyDB license: Free Edition