github-actions[bot] commented on code in PR #67144:
URL: https://github.com/apache/doris/pull/67144#discussion_r3859382150
##########
regression-test/suites/query_p0/subquery/test_subquery_in_project.groovy:
##########
@@ -138,6 +138,30 @@ suite("test_subquery_in_project") {
select sum(age + (select sum(age) from test_sql)) from test_sql group
by dt, age order by 1;
"""
+ // two layered correlated predicates in one IN subquery: r.r1 = l.x
(inner) and q.r2 = l.x
+ // (outer). both must survive into the final semi join, otherwise the
finite right side
+ // (r1, r2) in {(0,2),(2,0)} has no row with r1 = x and r2 = x and the
wrong result (TRUE)
+ // is silently produced. see the correlation filter merge fix in
UnCorrelatedApplyFilter /
+ // UnCorrelatedApplyProjectFilter / UnCorrelatedApplyAggregateFilter.
+ qt_sql21 """
Review Comment:
[P2] Cover the Filter-to-Aggregate accumulation path
Both new oracles exercise `UnCorrelatedApplyProjectFilter`, then
`MergeProjectable`, then `UnCorrelatedApplyProjectFilter` again. The other
materially distinct changed path is reachable as `Apply(L, Filter(C_having,
Aggregate(Filter(C_where, R))))`: `UnCorrelatedApplyFilter` stores the
correlated HAVING predicate, then `UnCorrelatedApplyAggregateFilter` must merge
the correlated WHERE predicate. For `L={0,2}` and `R={(0,2),(2,0)}`, a
projected `EXISTS` with `WHERE r1=l.x GROUP BY r1,r2 HAVING r2=l.x` should
return false/false, but reverting the second call to overwrite returns
true/true—and neither added test fails. Please add this end-to-end `EXISTS`
case (or equivalent focused coverage for both callers) so the non-Project
accumulation path is protected.
--
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]