This is an automated email from the ASF dual-hosted git repository.

reshke pushed a commit to branch jdejii
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/jdejii by this push:
     new 83eb0ce3261 add expected
83eb0ce3261 is described below

commit 83eb0ce32611ebeee2a7ae0c87727b99b7e7e486
Author: reshke <[email protected]>
AuthorDate: Mon Aug 17 10:18:09 2026 +0000

    add expected
---
 src/test/regress/expected/join_gp.out | 50 +++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/src/test/regress/expected/join_gp.out 
b/src/test/regress/expected/join_gp.out
index e459d425fff..87e70e87dc1 100644
--- a/src/test/regress/expected/join_gp.out
+++ b/src/test/regress/expected/join_gp.out
@@ -3619,3 +3619,53 @@ drop table if exists repli_t1_pk;
 drop table if exists repli_t2_pk;
 drop table if exists repli_t3_pk;
 drop table if exists repli_t4_pk;
+--
+-- Test that a join qual containing an outer-level reference
+-- is correctly identified as referring to the outer
+-- query, so that the join motion is planned in the parent slice.
+--
+create table lat_oq_t2(i int) distributed by (i);
+create table lat_oq_t3(i int) distributed by (i);
+insert into lat_oq_t2 select generate_series(1,10);
+insert into lat_oq_t3 select generate_series(1,10);
+explain (costs off) select * from generate_series(1,2) t1, lateral (select 
t3.i from lat_oq_t2 t2 join lat_oq_t3 t3 on t2.i = t3.i + t1 order by 1) z;
+                                  QUERY PLAN                                  
+------------------------------------------------------------------------------
+ Nested Loop
+   ->  Function Scan on generate_series t1
+   ->  Materialize
+         ->  Sort
+               Sort Key: t3.i
+               ->  Hash Join
+                     Hash Cond: (t2.i = (t3.i + t1.t1))
+                     ->  Materialize
+                           ->  Gather Motion 3:1  (slice1; segments: 3)
+                                 ->  Seq Scan on lat_oq_t2 t2
+                     ->  Hash
+                           ->  Materialize
+                                 ->  Gather Motion 3:1  (slice2; segments: 3)
+                                       ->  Seq Scan on lat_oq_t3 t3
+ Optimizer: Postgres query optimizer
+(15 rows)
+
+select * from generate_series(1,2) t1, lateral (select t3.i from lat_oq_t2 t2 
join lat_oq_t3 t3 on t2.i = t3.i + t1 order by 1) z;
+ t1 | i 
+----+---
+  1 | 1
+  1 | 2
+  1 | 3
+  1 | 4
+  1 | 5
+  1 | 6
+  1 | 7
+  1 | 8
+  1 | 9
+  2 | 1
+  2 | 2
+  2 | 3
+  2 | 4
+  2 | 5
+  2 | 6
+  2 | 7
+  2 | 8
+(17 rows)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to