heavyai / heavydb

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

[Crash Bug] SELECT * FROM <table> JOIN <table> ON CAST(<number> AS BOOLEAN) WHERE FALSE Brings Errors #811

Open qwebug opened 10 months ago

qwebug commented 10 months ago

Describe:

HeavyDB will crash when using SELECT * FROM \

JOIN \
ON CAST(\ AS BOOLEAN) WHERE FALSE, after SET EXECUTOR_DEVICE='GPU'.

SQL:

ALTER SESSION SET EXECUTOR_DEVICE='GPU';
CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c0 INT);
SELECT * FROM t1 JOIN t0 ON CAST(1 AS BOOLEAN) WHERE FALSE;

Result:

2023-10-18T02:58:46.458382 F 2867 11 9 RelLeftDeepInnerJoin.cpp:70 Check failed: dynamic_cast<const RexOperator*>(condition_.get())
Stack trace:
RelLeftDeepInnerJoin::RelLeftDeepInnerJoin
create_left_deep_join
RelAlgDagBuilder::optimizeDag
RelAlgDagBuilder::build
RelAlgDagBuilder::buildDag
DBHandler::execute_rel_alg
QueryDispatchQueue::worker
clone
/opt/heavyai/scripts/innerstartheavy: line 180:  2867 Aborted                 (core dumped) ./bin/heavydb $MAPD_DATA $RO --port $MAPD_TCP_PORT --http-port $MAPD_HTTP_PORT --calcite-port $MAPD_CALCITE_PORT $CONFIG $VERBOSE $*
Failed to write to log, write storage/log/heavy_web_server.7ff8a2f8be28.root.log.ALL.20231018-025831.2868: file already closed
startheavy 2856 exited

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

cdessanti commented 10 months ago

Duplicated Issue of #810

qwebug commented 7 months ago

This issue is different from https://github.com/heavyai/heavydb/issues/810 in that they both cause crashes due to different forms of SQL.