Skip to content

Commit

Permalink
indent
Browse files Browse the repository at this point in the history
  • Loading branch information
paragikjain committed Jul 13, 2024
1 parent 98ac3aa commit 9243b59
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 60 deletions.
84 changes: 42 additions & 42 deletions src/test/regress/expected/merge_vcore.out
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@ SELECT * FROM target;
(2 rows)

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;
QUERY PLAN
QUERY PLAN
---------------------------------------------------------------------
Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0)
Custom Scan (Citus MERGE INTO ...)
MERGE INTO target method: pull to coordinator
-> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0)
-> Custom Scan (Citus Adaptive)
Task Count: 1
Tasks Shown: All
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000000 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000000 source
(8 rows)

DROP TABLE IF EXISTS source;
Expand Down Expand Up @@ -151,19 +151,19 @@ SELECT * FROM target;
(2 rows)

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;
QUERY PLAN
QUERY PLAN
---------------------------------------------------------------------
Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0)
Custom Scan (Citus MERGE INTO ...)
MERGE INTO target method: pull to coordinator
-> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0)
-> Custom Scan (Citus Adaptive)
Task Count: 1
Tasks Shown: All
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000002 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000002 source
(8 rows)

DROP TABLE IF EXISTS source;
Expand Down Expand Up @@ -221,28 +221,28 @@ SELECT * FROM target;
(2 rows)

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;
QUERY PLAN
QUERY PLAN
---------------------------------------------------------------------
Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0)
Custom Scan (Citus MERGE INTO ...)
MERGE INTO target method: pull to coordinator
-> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=40)
-> Custom Scan (Citus Adaptive)
Task Count: 4
Tasks Shown: All
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000007 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000007 source
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000008 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000008 source
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000009 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000009 source
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000010 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000010 source
(17 rows)

DROP TABLE IF EXISTS source;
Expand Down Expand Up @@ -300,28 +300,28 @@ SELECT * FROM target;
(2 rows)

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;
QUERY PLAN
QUERY PLAN
---------------------------------------------------------------------
Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0)
Custom Scan (Citus MERGE INTO ...)
MERGE INTO target method: repartition
-> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=40)
-> Custom Scan (Citus Adaptive)
Task Count: 4
Tasks Shown: All
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000012 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000012 source
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000013 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000013 source
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000014 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000014 source
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000015 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000015 source
(17 rows)

DROP TABLE IF EXISTS source;
Expand Down Expand Up @@ -379,28 +379,28 @@ SELECT * FROM target;
(2 rows)

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;
QUERY PLAN
QUERY PLAN
---------------------------------------------------------------------
Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0)
Custom Scan (Citus MERGE INTO ...)
MERGE INTO target method: repartition
-> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=40)
-> Custom Scan (Citus Adaptive)
Task Count: 4
Tasks Shown: All
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000020 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000020 source
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000021 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000021 source
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000022 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000022 source
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on source_4000023 source (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on source_4000023 source
(17 rows)

DROP TABLE IF EXISTS source;
Expand Down Expand Up @@ -458,21 +458,21 @@ SELECT * FROM target;
(2 rows)

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;
QUERY PLAN
QUERY PLAN
---------------------------------------------------------------------
Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0)
Custom Scan (Citus Adaptive)
Task Count: 1
Tasks Shown: All
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Merge on target_4000029 target (cost=0.00..137.01 rows=0 width=0)
-> Nested Loop (cost=0.00..137.01 rows=7200 width=6)
-> Seq Scan on source_4000028 source (cost=0.00..22.00 rows=1200 width=0)
-> Materialize (cost=0.00..25.03 rows=6 width=6)
-> Seq Scan on target_4000029 target (cost=0.00..25.00 rows=6 width=6)
-> Merge on target_4000029 target
-> Nested Loop
-> Seq Scan on source_4000028 source
-> Materialize
-> Seq Scan on target_4000029 target
Filter: ('2'::bigint = id)
(11 rows)

Expand Down
6 changes: 6 additions & 0 deletions src/test/regress/expected/merge_vcore_0.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SHOW server_version \gset
SELECT substring(:'server_version', '\d+')::int >= 15 AS server_version_ge_15
\gset
\if :server_version_ge_15
\else
\q
36 changes: 18 additions & 18 deletions src/test/regress/sql/merge_vcore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SELECT create_distributed_table('target', null, colocate_with=>'none');
INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}');

-- insert
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -54,7 +54,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- update
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -65,7 +65,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;

Expand All @@ -91,7 +91,7 @@ SELECT create_distributed_table('target', 'id');
INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}');

-- insert
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -102,7 +102,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- update
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -113,7 +113,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;

Expand All @@ -140,7 +140,7 @@ SELECT create_distributed_table('target', null);
INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}');

-- insert
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -151,7 +151,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- update
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -162,7 +162,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;

Expand All @@ -187,7 +187,7 @@ SELECT create_distributed_table('target', 'id');
INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}');

-- insert
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -198,7 +198,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- update
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -209,7 +209,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;

Expand All @@ -235,7 +235,7 @@ SELECT create_distributed_table('target', 'id', colocate_with=>'source');
INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}');

-- insert
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -246,7 +246,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- update
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -257,7 +257,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;

Expand All @@ -283,7 +283,7 @@ SELECT create_distributed_table('target', null, colocate_with=>'source');
INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}');

-- insert
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -294,7 +294,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- update
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id) AND src.doc = target.doc
WHEN MATCHED THEN
UPDATE SET doc = '{"b" : 1}'
Expand All @@ -305,7 +305,7 @@ VALUES (src.t_id, doc);
SELECT * FROM target;

-- Explain
EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src
ON (src.t_id = target.id)
WHEN MATCHED THEN DO NOTHING;

Expand Down

0 comments on commit 9243b59

Please sign in to comment.