Use correct expression function after filter pushdown#17860
Conversation
|
Thanks for the PR! The change location makes sense - but I wonder if we can't move the result expression back instead of copying the function? It seems that that is quite limited in the scenarios it would correctly support (e.g. what if the |
|
Hmmm, I started working on it and am a bit stuck. Maybe we can transform the expression again via the column binding resolver? |
… same for table refs
|
nvm, figured it out. The physical column index is the same for all bound refs, so we can just iterate through the table filter once to find it, do the transformation & statistics propagation, then create the |
Mytherin
left a comment
There was a problem hiding this comment.
Thanks! Looks good - one minor comment
| @@ -0,0 +1,120 @@ | |||
| WITH year_total AS | |||
There was a problem hiding this comment.
Are these intended to be added?
There was a problem hiding this comment.
no, must added it accidentally. will revert it
|
Thanks! |
Use correct expression function after filter pushdown (duckdb/duckdb#17860) Disable constexpr std::mutex on Windows (duckdb/duckdb#17991)
Use correct expression function after filter pushdown (duckdb/duckdb#17860) Disable constexpr std::mutex on Windows (duckdb/duckdb#17991) Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Fixes https://github.com/duckdblabs/duckdb-internal/issues/5064
We would only perform statistics propagation on a copy of the filter. Statistics propagation sets the expression function, so we need to make sure we set the expression function back on the original expression function as well.