Describe the bug
The Unparser doesn't support IS DISTINCT FROM in statements. This break things, especially with the new array_has null semantics (#21743) and optimizer passes.
I.e, the following fails outright in the unparser:
SELECT value IS DISTINCT FROM 1 FROM t
The following fails after an optimization pass:
SELECT CASE WHEN value > 0 THEN true ELSE false END FROM t
To Reproduce
Simple to fail:
#[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
Describe the bug
The Unparser doesn't support
IS DISTINCT FROMin statements. This break things, especially with the newarray_hasnull semantics (#21743) and optimizer passes.I.e, the following fails outright in the unparser:
The following fails after an optimization pass:
To Reproduce
Simple to fail:
Expected behavior
No response
Additional context
No response