alamb commented on issue #13659:
URL: https://github.com/apache/datafusion/issues/13659#issuecomment-2541722186
Postgres appears to simply plan this type of query as a NestedLoops join:
```sql
Nested Loop (cost=0.00..295.60 rows=13600 width=36)
Output: u.c1, unnest.unnest
-> Seq Scan on public.unnest_test u (cost=0.00..23.60 rows=1360
width=32)
Output: u.c1
-> Function Scan on pg_catalog.unnest (cost=0.00..0.10 rows=10 width=4)
Output: unnest.unnest
Function Call: unnest(u.c1)
```
🤔
I think the postgres join operator re-evaluates the right input
(`pg_catalog.unnest`) on each input row to the join which is how the lateral
joins can refer to the outer query
The current DataFusion join operators don't run the input over and over
again -- they normally run each input and then combine them (they don't restart
inputs)
So in a query like
```sql
select * from t1, unnest(t1.c1)
```
I think we would need a (new) type of JoinExec that actually does run the
outer query (aka `unnest(t1.c1)` for each input row of `t1`) 🤔
--
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]