Copilot commented on code in PR #27737:
URL: https://github.com/apache/datafusion/pull/27737#discussion_r4690961950
##########
datafusion/expr/src/logical_plan/invariants.rs:
##########
@@ -416,6 +416,9 @@ fn strip_inner_query(inner_plan: &LogicalPlan) ->
&LogicalPlan {
strip_inner_query(projection.input.as_ref())
}
LogicalPlan::SubqueryAlias(alias) =>
strip_inner_query(alias.input.as_ref()),
+ LogicalPlan::MaterializedCte(MaterializedCtePlan::Cte(cte)) => {
+ strip_inner_query(cte.continuation.as_ref())
Review Comment:
Replacing `max(y)` with `count(*)` in the new `c.x = t.k + 2` test returns
`NULL` instead of `0` for `k=3` and `k=4`. The newly accepted CTE wrapper loses
the continuation's `collected_count_expr_map` entry, which `build_join` needs
to restore empty-input values. Propagate that entry to the rewritten
`MaterializedCte` node in `PullUpCorrelatedExpr` and add an unmatched-row
`COUNT` regression.
--
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]