Jefffrey commented on issue #16684:
URL: https://github.com/apache/datafusion/issues/16684#issuecomment-3358745430
Ah that's a good catch; it seems the alias `ns` in the recursive term is
what is causing the issue:
```sql
WITH RECURSIVE number_series AS (
SELECT id, 1 as level
FROM hierarchy
WHERE id = 1
UNION ALL
SELECT ns.id + 1, ns.level + 1
FROM number_series ns -- this
WHERE ns.id < 10
)
SELECT * FROM number_series ORDER BY id
```
The PR that was merged skips the pushdown if it detects an alias other than
the name used for the recursive term for simplicity; I raised #17853 to track
the fix to make it work even with nested subqueries/aliases but it seems this
issue needs to remain open because it needs that fix too.
Fyi @kosiew
--
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]