This is an automated email from the ASF dual-hosted git repository.
hello-stephen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new fd142ddeec3 [fix](regression) stabilize eliminate_inner aggregate
phase (#64957)
fd142ddeec3 is described below
commit fd142ddeec3d6807d2ef3dcbfc6a394748f10387
Author: shuke <[email protected]>
AuthorDate: Wed Jul 1 15:17:46 2026 +0800
[fix](regression) stabilize eliminate_inner aggregate phase (#64957)
## Summary
- add statement-local `SET_VAR(agg_phase=2)` hints to the two `UNION
DISTINCT` checks in `nereids_rules_p0/pkfk/eliminate_inner.groovy`
- keep the existing golden shape stable by forcing the intended
two-phase aggregate only for the affected statements
- avoid changing suite-wide session state or unrelated checks
---
regression-test/suites/nereids_rules_p0/pkfk/eliminate_inner.groovy | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/regression-test/suites/nereids_rules_p0/pkfk/eliminate_inner.groovy
b/regression-test/suites/nereids_rules_p0/pkfk/eliminate_inner.groovy
index 531ec4d5a06..8ab9c79c42b 100644
--- a/regression-test/suites/nereids_rules_p0/pkfk/eliminate_inner.groovy
+++ b/regression-test/suites/nereids_rules_p0/pkfk/eliminate_inner.groovy
@@ -96,7 +96,7 @@ suite("eliminate_inner") {
check_shape_res("select fkt_not_null.*, pkt.pk from pkt inner join (select
fkt_not_null1.* from fkt_not_null as fkt_not_null1 join fkt_not_null as
fkt_not_null2 on fkt_not_null1.fk = fkt_not_null2.fk) fkt_not_null on pkt.pk =
fkt_not_null.fk;", "with_pk_col")
check_shape_res("select fkt_not_null.*, pkt.pk from pkt inner join (select
fkt_not_null1.* from fkt_not_null as fkt_not_null1 join fkt_not_null as
fkt_not_null2 on fkt_not_null1.fk = fkt_not_null2.fk where fkt_not_null1.fk >
1) fkt_not_null on pkt.pk = fkt_not_null.fk;", "with_pk_col")
check_shape_res("select fkt_not_null.*, pkt.pk from pkt inner join (select
fkt_not_null1.fk from fkt_not_null as fkt_not_null1 group by fkt_not_null1.fk)
fkt_not_null on pkt.pk = fkt_not_null.fk;", "with_pk_col")
- check_shape_res("select fkt_not_null.*, pkt.pk from pkt inner join (select
* from fkt_not_null union select * from fkt_not_null) fkt_not_null on pkt.pk =
fkt_not_null.fk;", "with_pk_col")
+ check_shape_res("select /*+ SET_VAR(agg_phase=2) */ fkt_not_null.*, pkt.pk
from pkt inner join (select * from fkt_not_null union select * from
fkt_not_null) fkt_not_null on pkt.pk = fkt_not_null.fk;", "with_pk_col")
check_shape_res("select fkt_not_null.*, pkt.pk from pkt inner join (select
fk, ROW_NUMBER() OVER (PARTITION BY fk ORDER BY fk) AS RowNum from
fkt_not_null) fkt_not_null on pkt.pk = fkt_not_null.fk;", "fk with window")
check_shape_res("select fkt_not_null.*, pkt.pk from pkt inner join (select
fk from fkt_not_null order by fk limit 1) fkt_not_null on pkt.pk =
fkt_not_null.fk;", "fk with limit")
check_shape_res("select fkt_not_null.*, pkt.pk from pkt inner join
fkt_not_null on pkt.pk = fkt_not_null.fk where pkt.pk = 1 and fkt_not_null.fk =
1;", "pk with filter that same as fk")
@@ -109,7 +109,7 @@ suite("eliminate_inner") {
check_shape_res("select fkt.*, pkt.pk from pkt inner join (select fkt1.*
from fkt as fkt1 join fkt as fkt2 on fkt1.fk = fkt2.fk) fkt on pkt.pk =
fkt.fk;", "with_pk_col")
check_shape_res("select fkt.*, pkt.pk from pkt inner join (select fkt1.*
from fkt as fkt1 join fkt as fkt2 on fkt1.fk = fkt2.fk where fkt1.fk > 1) fkt
on pkt.pk = fkt.fk;", "with_pk_col")
check_shape_res("select fkt.*, pkt.pk from pkt inner join (select fkt1.fk
from fkt as fkt1 group by fkt1.fk) fkt on pkt.pk = fkt.fk;", "with_pk_col")
- check_shape_res("select fkt.*, pkt.pk from pkt inner join (select * from
fkt union select * from fkt) fkt on pkt.pk = fkt.fk;", "with_pk_col")
+ check_shape_res("select /*+ SET_VAR(agg_phase=2) */ fkt.*, pkt.pk from pkt
inner join (select * from fkt union select * from fkt) fkt on pkt.pk =
fkt.fk;", "with_pk_col")
check_shape_res("select fkt.*, pkt.pk from pkt inner join (select fk,
ROW_NUMBER() OVER (PARTITION BY fk ORDER BY fk) AS RowNum from fkt) fkt on
pkt.pk = fkt.fk;", "fk with window")
check_shape_res("select fkt.*, pkt.pk from pkt inner join (select fk from
fkt order by fk limit 1 ) fkt on pkt.pk = fkt.fk;", "fk with limit")
check_shape_res("select fkt.*, pkt.pk from pkt inner join fkt on pkt.pk =
fkt.fk where pkt.pk = 1 and fkt.fk = 1;", "pk with filter that same as fk")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]