xudong963 edited a comment on issue #1082:
URL:
https://github.com/apache/arrow-datafusion/issues/1082#issuecomment-942442780
> perhaps since `NULL = NULL` is not true, then semi join with equality
isn't correct. 🤔
Yes.
```sql
postgres=# select * from bar;
a | b
---+---
1 | 2
| 3
3 | 4
(3 rows)
postgres=# select * from foo;
a | b
---+---
1 | 2
| 3
(2 rows)
-- intersect
select a from foo intersect select a from bar;
/**
a
---
1
(2 rows)
**/
-- equivalent transformation ? (x) since NULL = NULL is not true
select distinct a from foo where a in (select a from bar);
/**
a
---
1
(1 row)
**/
```
psql doesn't seem to have direct `SEMI JOIN`. It uses `IN` to do the same
thing as `SEMI JOIN`. So how to use `is distinct from` in `select distinct a
from foo where a in (select a from bar);`?
--
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]