2010YOUY01 opened a new issue, #11412:
URL: https://github.com/apache/datafusion/issues/11412

   ### 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 https://github.com/apache/datafusion/issues/11030


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to