alamb commented on PR #21054:
URL: https://github.com/apache/datafusion/pull/21054#issuecomment-4114080400
> @alamb Sorry, I didn't write it clearly. PostgreSQL does not support using
STRUCT directly. We can use a shorthand notation: "SELECT (7521, 30) IN ((7521,
NULL))". This SQL can be executed in PostgreSQL.
Thanks @xiedeyantu. I am not quite sure this is exactly the same, though I
get your point
I think the query you show in Postgres it is a "tuple"
```sql
postgres=# select (7521, 30);
row
-----------
(7521,30)
(1 row)
```
In DataFusion it translates to a struct type .
```sql
> select struct(7521, 30);
+-------------------------------+
| struct(Int64(7521),Int64(30)) |
+-------------------------------+
| {c0: 7521, c1: 30} |
+-------------------------------+
1 row(s) fetched.
Elapsed 0.032 seconds.
```
I think DataFusion's semantics matches duckdb (which returns false rather
than apply standard NULL semantics)
```sql
memory D select {c0: 7521, c1:30} IN ({c0: 7521, c1:NULL});
┌──────────────────────────────────────────────────────────────────────────────┐
│ (main.struct_pack(c0 := 7521, c1 := 30) IN (main.struct_pack(c0 := 7521,
c1 │
│ := NULL)))
│
│ boolean
│
├──────────────────────────────────────────────────────────────────────────────┤
│ false
│
└──────────────────────────────────────────────────────────────────────────────┘
memory D
```
So therefore I am not sure this is a bug fix -- but rather a behavior change
--
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]