You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "pabadrubio (via GitHub)" <gi...@apache.org> on 2026/05/29 10:08:43 UTC
[PR] fix: make PushDownLeafProjections work with unnest [datafusion]
pabadrubio opened a new pull request, #22620:
URL: https://github.com/apache/datafusion/pull/22620
## Which issue does this PR close?
Closes https://github.com/apache/datafusion/issues/22615.
## Rationale for this change
`PushDownLeafProjections` throws an error when it tries to push down an expression through an `Unnest` node. It also tries to push leaf projections incorrectly for `Unnest` nodes.
## What changes are included in this PR?
This PR makes PushDownLeafProjections never push down leaf expressions through Unnest nodes. This avoids the code in `try_push_into_inputs` from calling:
```
let new_node = node.with_new_exprs(node.expressions(), new_inputs)?;
```
on an Unnest node, which doesn't work.
Changing that line is not enough, as even in that case the code in `try_push_into_inputs` to decide when to push down a projection is not valid for Unnest nodes, as explained in ....
In this PR, I only want to make sure that the optimizer works for Unnest cases, but we could probably do better and allow leaf expressions push downs when the expression refer to a column that is not being unnested.
## Are these changes tested?
Added unit tests and `.slt` tests for these cases.
## Are there any user-facing changes?
No
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: make PushDownLeafProjections work with unnest [datafusion]
Posted by "gabotechs (via GitHub)" <gi...@apache.org>.
gabotechs merged PR #22620:
URL: https://github.com/apache/datafusion/pull/22620
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org