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

Internal Error for an INNER JOIN query (SQLancer) #11412

Closed
2010YOUY01 opened this issue Jul 11, 2024 · 1 comment · Fixed by #11578
Closed

Internal Error for an INNER JOIN query (SQLancer) #11412

2010YOUY01 opened this issue Jul 11, 2024 · 1 comment · Fixed by #11578
Assignees
Labels
bug Something isn't working

Comments

@2010YOUY01
Copy link
Contributor

Describe the bug

This query should be valid and can be executed on DuckDB, but produced an Internal Error when building initial physical plan.
Full reproducer:

/*DML*/CREATE TABLE t60(v0 BIGINT, v1 BIGINT, v2 BOOLEAN, v3 BOOLEAN);
/*DML*/CREATE TABLE t0(v0 DOUBLE, v1 BIGINT);
/*DML*/CREATE TABLE t1(v0 DOUBLE);
SELECT COUNT(*)
FROM t1
NATURAL JOIN t60
INNER JOIN t0
ON t60.v1 = t0.v0
AND t0.v1 > t60.v1;

Error messages

> SELECT COUNT(*)
FROM t1
NATURAL JOIN t60
INNER JOIN t0
ON t60.v1 = t0.v0
AND t0.v1 > t60.v1;

Internal error: Invalid join key. Expected column, found Cast(Cast { expr: Column(Column { relation: Some(Bare { table: "t60" }), name: "v0" }), data_type: Float64 }).
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

> explain verbose SELECT COUNT(*)
FROM t1
NATURAL JOIN t60
INNER JOIN t0
ON t60.v1 = t0.v0
AND t0.v1 > t60.v1;

...

 initial_physical_plan                                      | Internal error: Invalid join key. Expected column, found Cast(Cast { expr: Column(Column { relation: Some(Bare { table: "t60" }), name: "v0" }), data_type: Float64 }). |
|                                                            | This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker                                              |
+------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

To Reproduce

No response

Expected behavior

No response

Additional context

Found by SQLancer #11030

@2010YOUY01 2010YOUY01 added the bug Something isn't working label Jul 11, 2024
@xinlifoobar
Copy link
Contributor

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants