jonahgao opened a new pull request, #11423:
URL: https://github.com/apache/datafusion/pull/11423

   ## Which issue does this PR close?
   
   
   Closes #11414.
   
   ## Rationale for this change
   The query in the issue generates the following plan after some optimizations.
   ```sql
   select * from t1 inner join t2 on null right join t3 on true;
   ```
   ```sh
       Projection: t1.v1, t2.v1, t3.v1
         Right Join:
           Inner Join:
             Filter: Boolean(true) AND NULL
               TableScan: t1
             TableScan: t2
           TableScan: t3
   ```
   When the `simplify_expressions` rule attempts to simplify `Boolean(true) AND 
NULL`,  it fails because the operand types on both sides are different 
(`DataType::Boolean` vs `DataType::NULL`).
   
   The fix is to cast the NULL type to  Boolean type.
   
   ## What changes are included in this PR?
   
   
   ## Are these changes tested?
   Yes
   
   ## Are there any user-facing changes?
   No
   


-- 
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