cetra3 opened a new issue, #22053:
URL: https://github.com/apache/datafusion/issues/22053

   ### Describe the bug
   
   The Unparser doesn't support `IS DISTINCT FROM` in statements.   This break 
things, especially with the new `array_has` null semantics 
(https://github.com/apache/datafusion/pull/21743) and optimizer passes.
   
   I.e, the following fails outright in the unparser:
   
   ```sql
   SELECT value IS DISTINCT FROM 1 FROM t
   ```
   
   The following fails after an optimization pass:
   
   ```sql
   SELECT CASE WHEN value > 0 THEN true ELSE false END FROM t
   ```
   
   ### To Reproduce
   
   Simple to fail:
   
   ```rust
   #[tokio::test]
   async fn unparse_is_distinct_from() -> Result<()> {
       let ctx = SessionContext::new();
   
       let schema = Arc::new(Schema::new(vec![Field::new(
           "value",
           DataType::Int32,
           true,
       )]));
       ctx.register_table("t", Arc::new(MemTable::try_new(schema, 
vec![vec![]])?))?;
   
       let df = ctx
           .sql("SELECT value IS DISTINCT FROM 1 FROM t")
           .await?;
   
       let sql = plan_to_sql(df.logical_plan())?;
   
       Ok(())
   }
   ```
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


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