Skip to content

Commit

Permalink
fixing flakyness in test
Browse files Browse the repository at this point in the history
(cherry picked from commit 9e71750)
  • Loading branch information
LordParag committed Jun 17, 2024
1 parent 74f2b7f commit 78fec3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
18 changes: 1 addition & 17 deletions src/test/regress/expected/merge.out
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,7 @@ DEBUG: Creating MERGE router plan
(47 rows)

-- Test 2 : tables are colocated AND source query is not multisharded : should push down to worker.
EXPLAIN (costs off, timing off, summary off)
-- DEBUG LOGS show that query is getting pushed down
MERGE INTO target_pushdowntest t
USING (SELECT * from source_pushdowntest where id = 1) s
on t.id = s.id
Expand All @@ -1953,22 +1953,6 @@ WHEN NOT MATCHED THEN
VALUES (s.id);
DEBUG: <Deparsed MERGE query: MERGE INTO merge_schema.target_pushdowntest_xxxxxxx t USING (SELECT source_pushdowntest.id FROM merge_schema.source_pushdowntest_xxxxxxx source_pushdowntest WHERE (source_pushdowntest.id OPERATOR(pg_catalog.=) 1)) s ON (t.id OPERATOR(pg_catalog.=) s.id) WHEN NOT MATCHED THEN INSERT (id) VALUES (s.id)>
DEBUG: Creating MERGE router plan
QUERY PLAN
---------------------------------------------------------------------
Custom Scan (Citus Adaptive)
Task Count: 1
Tasks Shown: All
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Merge on target_pushdowntest_4000068 t
-> Nested Loop Left Join
-> Seq Scan on source_pushdowntest_4000064 source_pushdowntest
Filter: (id = 1)
-> Materialize
-> Seq Scan on target_pushdowntest_4000068 t
Filter: (id = 1)
(12 rows)

-- Test 3 : tables are colocated source query is single sharded but not using source distributed column in insertion. let's not pushdown.
INSERT INTO source_pushdowntest (id) VALUES (3);
EXPLAIN (costs off, timing off, summary off)
Expand Down
6 changes: 2 additions & 4 deletions src/test/regress/sql/merge.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1224,14 +1224,13 @@ WITH colocations AS (
WHERE logicalrelid = 'source_pushdowntest'::regclass
OR logicalrelid = 'target_pushdowntest'::regclass
)
SELECT
SELECT
CASE
WHEN COUNT(DISTINCT colocationid) = 1 THEN 'Same'
ELSE 'Different'
END AS colocation_status
FROM colocations;


SET client_min_messages TO DEBUG1;
-- Test 1 : tables are colocated AND query is multisharded AND Join On distributed column : should push down to workers.

Expand All @@ -1244,8 +1243,7 @@ WHEN NOT MATCHED THEN
VALUES (s.id);

-- Test 2 : tables are colocated AND source query is not multisharded : should push down to worker.

EXPLAIN (costs off, timing off, summary off)
-- DEBUG LOGS show that query is getting pushed down
MERGE INTO target_pushdowntest t
USING (SELECT * from source_pushdowntest where id = 1) s
on t.id = s.id
Expand Down

0 comments on commit 78fec3d

Please sign in to comment.