diff --git a/src/test/regress/expected/citus_split_shard_by_split_points.out b/src/test/regress/expected/citus_split_shard_by_split_points.out index 08be89bbd..dba6a3d71 100644 --- a/src/test/regress/expected/citus_split_shard_by_split_points.out +++ b/src/test/regress/expected/citus_split_shard_by_split_points.out @@ -114,16 +114,16 @@ SELECT shard.shardid, logicalrelid, shardstorage, shardminvalue, shardmaxvalue n ORDER BY logicalrelid, shardminvalue::BIGINT; shardid | logicalrelid | shardstorage | shardminvalue | nodename | nodeport | placementid --------------------------------------------------------------------- - 82060012 | lineitem_streaming | t | -2147483648 | 268435455 | 57637 | 129 - 82060013 | lineitem_streaming | t | 268435456 | 536870911 | 57637 | 130 - 82060014 | lineitem_streaming | t | 536870912 | 1073741823 | 57638 | 131 - 82060015 | lineitem_streaming | t | 1073741824 | 1610612735 | 57638 | 132 - 82060016 | lineitem_streaming | t | 1610612736 | 2147483647 | 57638 | 133 - 82060017 | orders_streaming | t | -2147483648 | 268435455 | 57637 | 134 - 82060018 | orders_streaming | t | 268435456 | 536870911 | 57637 | 135 - 82060019 | orders_streaming | t | 536870912 | 1073741823 | 57638 | 136 - 82060020 | orders_streaming | t | 1073741824 | 1610612735 | 57638 | 137 - 82060021 | orders_streaming | t | 1610612736 | 2147483647 | 57638 | 138 + 82060002 | lineitem_streaming | t | -2147483648 | 268435455 | 57637 | 119 + 82060003 | lineitem_streaming | t | 268435456 | 536870911 | 57637 | 120 + 82060004 | lineitem_streaming | t | 536870912 | 1073741823 | 57638 | 121 + 82060005 | lineitem_streaming | t | 1073741824 | 1610612735 | 57638 | 122 + 82060006 | lineitem_streaming | t | 1610612736 | 2147483647 | 57638 | 123 + 82060007 | orders_streaming | t | -2147483648 | 268435455 | 57637 | 124 + 82060008 | orders_streaming | t | 268435456 | 536870911 | 57637 | 125 + 82060009 | orders_streaming | t | 536870912 | 1073741823 | 57638 | 126 + 82060010 | orders_streaming | t | 1073741824 | 1610612735 | 57638 | 127 + 82060011 | orders_streaming | t | 1610612736 | 2147483647 | 57638 | 128 (10 rows) -- Cleanup for Test. diff --git a/src/test/regress/expected/worker_split_binary_copy_test.out b/src/test/regress/expected/worker_split_binary_copy_test.out index a0dc3424b..0453530d1 100644 --- a/src/test/regress/expected/worker_split_binary_copy_test.out +++ b/src/test/regress/expected/worker_split_binary_copy_test.out @@ -4,31 +4,111 @@ SET citus.shard_count TO 1; SET citus.shard_replication_factor TO 1; SET citus.next_shard_id TO 81060000; -- BEGIN: Create distributed table and insert data. -CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy (id bigserial PRIMARY KEY, value char); -SELECT create_distributed_table('shard_to_split_copy','id'); +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); +SELECT create_distributed_table('shard_to_split_copy', 'l_orderkey'); create_distributed_table --------------------------------------------------------------------- (1 row) -INSERT INTO worker_split_binary_copy_test.shard_to_split_copy (id, value) (SELECT g.id, 'c' FROM generate_series(1, 1000) AS g(id)); +\COPY shard_to_split_copy FROM STDIN WITH DELIMITER '|' -- END: Create distributed table and insert data. -- BEGIN: Switch to Worker1, Create target shards in worker for local 2-way split copy. \c - - - :worker_1_port -CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060015 (id bigserial PRIMARY KEY, value char); -CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060016 (id bigserial PRIMARY KEY, value char); +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060015 ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060016 ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); -- End: Switch to Worker1, Create target shards in worker for local 2-way split copy. -- BEGIN: Switch to Worker2, Create target shards in worker for remote 2-way split copy. \c - - - :worker_2_port -CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060015 (id bigserial PRIMARY KEY, value char); -CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060016 (id bigserial PRIMARY KEY, value char); +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060015 ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060016 ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); -- End: Switch to Worker2, Create target shards in worker for remote 2-way split copy. -- BEGIN: List row count for source shard and targets shard in Worker1. \c - - - :worker_1_port SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060000; count --------------------------------------------------------------------- - 1000 + 22 (1 row) SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060015; @@ -65,6 +145,8 @@ SELECT nodeid AS worker_1_node FROM pg_dist_node WHERE nodeport=:worker_1_port \ SELECT nodeid AS worker_2_node FROM pg_dist_node WHERE nodeport=:worker_2_port \gset -- END: Set worker_1_node and worker_2_node -- BEGIN: Trigger 2-way local shard split copy. +-- Ensure we will perform binary copy. +SET citus.enable_binary_protocol = true; SELECT * from worker_split_copy( 81060000, -- source shard id to copy ARRAY[ @@ -112,13 +194,13 @@ SELECT * from worker_split_copy( SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060015; count --------------------------------------------------------------------- - 748 + 21 (1 row) SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060016; count --------------------------------------------------------------------- - 252 + 1 (1 row) -- END: List updated row count for local targets shard. @@ -127,19 +209,18 @@ SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060016; SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060015; count --------------------------------------------------------------------- - 748 + 21 (1 row) SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060016; count --------------------------------------------------------------------- - 252 + 1 (1 row) -- END: List updated row count for remote targets shard. -- BEGIN: CLEANUP. \c - - - :master_port SET client_min_messages TO WARNING; -DROP SCHEMA citus_split_shard_by_split_points_local CASCADE; -ERROR: schema "citus_split_shard_by_split_points_local" does not exist +DROP SCHEMA worker_split_binary_copy_test CASCADE; -- END: CLEANUP. diff --git a/src/test/regress/expected/worker_split_text_copy_test.out b/src/test/regress/expected/worker_split_text_copy_test.out index a46acab10..80aad97d8 100644 --- a/src/test/regress/expected/worker_split_text_copy_test.out +++ b/src/test/regress/expected/worker_split_text_copy_test.out @@ -4,33 +4,111 @@ SET citus.shard_count TO 1; SET citus.shard_replication_factor TO 1; SET citus.next_shard_id TO 81070000; -- BEGIN: Create distributed table and insert data. --- Add a complex type to table that will force text / non-binary copy. -CREATE TYPE worker_split_text_copy_test.complex_type_to_force_text_copy AS (value char, numval int); -CREATE TABLE worker_split_text_copy_test.shard_to_split_copy (id bigserial PRIMARY KEY, complexvalue worker_split_text_copy_test.complex_type_to_force_text_copy); -SELECT create_distributed_table('shard_to_split_copy','id'); +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); +SELECT create_distributed_table('shard_to_split_copy', 'l_orderkey'); create_distributed_table --------------------------------------------------------------------- (1 row) -INSERT INTO worker_split_text_copy_test.shard_to_split_copy (id, complexvalue) (SELECT g.id, ROW('c', g.id)::worker_split_text_copy_test.complex_type_to_force_text_copy FROM generate_series(1, 1000) AS g(id)); +\COPY shard_to_split_copy FROM STDIN WITH DELIMITER '|' -- END: Create distributed table and insert data. -- BEGIN: Switch to Worker1, Create target shards in worker for local 2-way split copy. \c - - - :worker_1_port -CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070015 (id bigserial PRIMARY KEY, complexvalue worker_split_text_copy_test.complex_type_to_force_text_copy); -CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070016 (id bigserial PRIMARY KEY, complexvalue worker_split_text_copy_test.complex_type_to_force_text_copy); +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070015 ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070016 ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); -- End: Switch to Worker1, Create target shards in worker for local 2-way split copy. -- BEGIN: Switch to Worker2, Create target shards in worker for remote 2-way split copy. \c - - - :worker_2_port -CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070015 (id bigserial PRIMARY KEY, complexvalue worker_split_text_copy_test.complex_type_to_force_text_copy); -CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070016 (id bigserial PRIMARY KEY, complexvalue worker_split_text_copy_test.complex_type_to_force_text_copy); +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070015 ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070016 ( + l_orderkey bigint not null, + l_partkey integer not null, + l_suppkey integer not null, + l_linenumber integer not null, + l_quantity decimal(15, 2) not null, + l_extendedprice decimal(15, 2) not null, + l_discount decimal(15, 2) not null, + l_tax decimal(15, 2) not null, + l_returnflag char(1) not null, + l_linestatus char(1) not null, + l_shipdate date not null, + l_commitdate date not null, + l_receiptdate date not null, + l_shipinstruct char(25) not null, + l_shipmode char(10) not null, + l_comment varchar(44) not null); -- End: Switch to Worker2, Create target shards in worker for remote 2-way split copy. -- BEGIN: List row count for source shard and targets shard in Worker1. \c - - - :worker_1_port SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070000; count --------------------------------------------------------------------- - 1000 + 22 (1 row) SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070015; @@ -67,6 +145,8 @@ SELECT nodeid AS worker_1_node FROM pg_dist_node WHERE nodeport=:worker_1_port \ SELECT nodeid AS worker_2_node FROM pg_dist_node WHERE nodeport=:worker_2_port \gset -- END: Set worker_1_node and worker_2_node -- BEGIN: Trigger 2-way local shard split copy. +-- Ensure we will perform text copy. +SET citus.enable_binary_protocol = false; SELECT * from worker_split_copy( 81070000, -- source shard id to copy ARRAY[ @@ -114,13 +194,13 @@ SELECT * from worker_split_copy( SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070015; count --------------------------------------------------------------------- - 748 + 21 (1 row) SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070016; count --------------------------------------------------------------------- - 252 + 1 (1 row) -- END: List updated row count for local targets shard. @@ -129,19 +209,18 @@ SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070016; SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070015; count --------------------------------------------------------------------- - 748 + 21 (1 row) SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070016; count --------------------------------------------------------------------- - 252 + 1 (1 row) -- END: List updated row count for remote targets shard. -- BEGIN: CLEANUP. \c - - - :master_port SET client_min_messages TO WARNING; -DROP SCHEMA citus_split_shard_by_split_points_local CASCADE; -ERROR: schema "citus_split_shard_by_split_points_local" does not exist +DROP SCHEMA worker_split_text_copy_test CASCADE; -- END: CLEANUP. diff --git a/src/test/regress/split_schedule b/src/test/regress/split_schedule index 55cf9d6ac..9d996a892 100644 --- a/src/test/regress/split_schedule +++ b/src/test/regress/split_schedule @@ -5,7 +5,7 @@ test: multi_cluster_management test: multi_test_catalog_views test: tablespace # Split tests go here. -test: worker_shard_binary_copy_test -test: worker_shard_text_copy_test +test: worker_split_binary_copy_test +test: worker_split_text_copy_test test: citus_split_shard_by_split_points_negative test: citus_split_shard_by_split_points diff --git a/src/test/regress/sql/worker_shard_binary_copy_test.sql b/src/test/regress/sql/worker_split_binary_copy_test.sql similarity index 88% rename from src/test/regress/sql/worker_shard_binary_copy_test.sql rename to src/test/regress/sql/worker_split_binary_copy_test.sql index 5afba15fe..03426f443 100644 --- a/src/test/regress/sql/worker_shard_binary_copy_test.sql +++ b/src/test/regress/sql/worker_split_binary_copy_test.sql @@ -1,11 +1,11 @@ -CREATE SCHEMA worker_shard_binary_copy_test; -SET search_path TO worker_shard_binary_copy_test; +CREATE SCHEMA worker_split_binary_copy_test; +SET search_path TO worker_split_binary_copy_test; SET citus.shard_count TO 1; SET citus.shard_replication_factor TO 1; SET citus.next_shard_id TO 81060000; -- BEGIN: Create distributed table and insert data. -CREATE TABLE worker_shard_binary_copy_test.shard_to_split_copy ( +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -53,7 +53,7 @@ SELECT create_distributed_table('shard_to_split_copy', 'l_orderkey'); -- BEGIN: Switch to Worker1, Create target shards in worker for local 2-way split copy. \c - - - :worker_1_port -CREATE TABLE worker_shard_binary_copy_test.shard_to_split_copy_81060015 ( +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060015 ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -70,7 +70,7 @@ CREATE TABLE worker_shard_binary_copy_test.shard_to_split_copy_81060015 ( l_shipinstruct char(25) not null, l_shipmode char(10) not null, l_comment varchar(44) not null); -CREATE TABLE worker_shard_binary_copy_test.shard_to_split_copy_81060016 ( +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060016 ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -91,7 +91,7 @@ CREATE TABLE worker_shard_binary_copy_test.shard_to_split_copy_81060016 ( -- BEGIN: Switch to Worker2, Create target shards in worker for remote 2-way split copy. \c - - - :worker_2_port -CREATE TABLE worker_shard_binary_copy_test.shard_to_split_copy_81060015 ( +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060015 ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -108,7 +108,7 @@ CREATE TABLE worker_shard_binary_copy_test.shard_to_split_copy_81060015 ( l_shipinstruct char(25) not null, l_shipmode char(10) not null, l_comment varchar(44) not null); -CREATE TABLE worker_shard_binary_copy_test.shard_to_split_copy_81060016 ( +CREATE TABLE worker_split_binary_copy_test.shard_to_split_copy_81060016 ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -129,15 +129,15 @@ CREATE TABLE worker_shard_binary_copy_test.shard_to_split_copy_81060016 ( -- BEGIN: List row count for source shard and targets shard in Worker1. \c - - - :worker_1_port -SELECT COUNT(*) FROM worker_shard_binary_copy_test.shard_to_split_copy_81060000; -SELECT COUNT(*) FROM worker_shard_binary_copy_test.shard_to_split_copy_81060015; -SELECT COUNT(*) FROM worker_shard_binary_copy_test.shard_to_split_copy_81060016; +SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060000; +SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060015; +SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060016; -- END: List row count for source shard and targets shard in Worker1. -- BEGIN: List row count for target shard in Worker2. \c - - - :worker_2_port -SELECT COUNT(*) FROM worker_shard_binary_copy_test.shard_to_split_copy_81060015; -SELECT COUNT(*) FROM worker_shard_binary_copy_test.shard_to_split_copy_81060016; +SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060015; +SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060016; -- END: List row count for targets shard in Worker2. -- BEGIN: Set worker_1_node and worker_2_node @@ -148,7 +148,7 @@ SELECT nodeid AS worker_2_node FROM pg_dist_node WHERE nodeport=:worker_2_port \ -- BEGIN: Trigger 2-way local shard split copy. -- Ensure we will perform binary copy. -SET citus.enable_binary_protocol = TRUE; +SET citus.enable_binary_protocol = true; SELECT * from worker_split_copy( 81060000, -- source shard id to copy @@ -186,18 +186,18 @@ SELECT * from worker_split_copy( -- END: Trigger 2-way remote shard split copy. -- BEGIN: List updated row count for local targets shard. -SELECT COUNT(*) FROM worker_shard_binary_copy_test.shard_to_split_copy_81060015; -SELECT COUNT(*) FROM worker_shard_binary_copy_test.shard_to_split_copy_81060016; +SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060015; +SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060016; -- END: List updated row count for local targets shard. -- BEGIN: List updated row count for remote targets shard. \c - - - :worker_2_port -SELECT COUNT(*) FROM worker_shard_binary_copy_test.shard_to_split_copy_81060015; -SELECT COUNT(*) FROM worker_shard_binary_copy_test.shard_to_split_copy_81060016; +SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060015; +SELECT COUNT(*) FROM worker_split_binary_copy_test.shard_to_split_copy_81060016; -- END: List updated row count for remote targets shard. -- BEGIN: CLEANUP. \c - - - :master_port SET client_min_messages TO WARNING; -DROP SCHEMA citus_split_shard_by_split_points_local CASCADE; +DROP SCHEMA worker_split_binary_copy_test CASCADE; -- END: CLEANUP. diff --git a/src/test/regress/sql/worker_shard_text_copy_test.sql b/src/test/regress/sql/worker_split_text_copy_test.sql similarity index 88% rename from src/test/regress/sql/worker_shard_text_copy_test.sql rename to src/test/regress/sql/worker_split_text_copy_test.sql index a4812d8f4..1fa5d476e 100644 --- a/src/test/regress/sql/worker_shard_text_copy_test.sql +++ b/src/test/regress/sql/worker_split_text_copy_test.sql @@ -1,12 +1,12 @@ -CREATE SCHEMA worker_shard_text_copy_test; -SET search_path TO worker_shard_text_copy_test; +CREATE SCHEMA worker_split_text_copy_test; +SET search_path TO worker_split_text_copy_test; SET citus.shard_count TO 1; SET citus.shard_replication_factor TO 1; SET citus.next_shard_id TO 81070000; -- BEGIN: Create distributed table and insert data. -CREATE TABLE worker_shard_text_copy_test.shard_to_split_copy ( +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -54,7 +54,7 @@ SELECT create_distributed_table('shard_to_split_copy', 'l_orderkey'); -- BEGIN: Switch to Worker1, Create target shards in worker for local 2-way split copy. \c - - - :worker_1_port -CREATE TABLE worker_shard_text_copy_test.shard_to_split_copy_81070015 ( +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070015 ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -71,7 +71,7 @@ CREATE TABLE worker_shard_text_copy_test.shard_to_split_copy_81070015 ( l_shipinstruct char(25) not null, l_shipmode char(10) not null, l_comment varchar(44) not null); -CREATE TABLE worker_shard_text_copy_test.shard_to_split_copy_81070016 ( +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070016 ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -92,7 +92,7 @@ CREATE TABLE worker_shard_text_copy_test.shard_to_split_copy_81070016 ( -- BEGIN: Switch to Worker2, Create target shards in worker for remote 2-way split copy. \c - - - :worker_2_port -CREATE TABLE worker_shard_text_copy_test.shard_to_split_copy_81070015 ( +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070015 ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -109,7 +109,7 @@ CREATE TABLE worker_shard_text_copy_test.shard_to_split_copy_81070015 ( l_shipinstruct char(25) not null, l_shipmode char(10) not null, l_comment varchar(44) not null); -CREATE TABLE worker_shard_text_copy_test.shard_to_split_copy_81070016 ( +CREATE TABLE worker_split_text_copy_test.shard_to_split_copy_81070016 ( l_orderkey bigint not null, l_partkey integer not null, l_suppkey integer not null, @@ -130,15 +130,15 @@ CREATE TABLE worker_shard_text_copy_test.shard_to_split_copy_81070016 ( -- BEGIN: List row count for source shard and targets shard in Worker1. \c - - - :worker_1_port -SELECT COUNT(*) FROM worker_shard_text_copy_test.shard_to_split_copy_81070000; -SELECT COUNT(*) FROM worker_shard_text_copy_test.shard_to_split_copy_81070015; -SELECT COUNT(*) FROM worker_shard_text_copy_test.shard_to_split_copy_81070016; +SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070000; +SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070015; +SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070016; -- END: List row count for source shard and targets shard in Worker1. -- BEGIN: List row count for target shard in Worker2. \c - - - :worker_2_port -SELECT COUNT(*) FROM worker_shard_text_copy_test.shard_to_split_copy_81070015; -SELECT COUNT(*) FROM worker_shard_text_copy_test.shard_to_split_copy_81070016; +SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070015; +SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070016; -- END: List row count for targets shard in Worker2. -- BEGIN: Set worker_1_node and worker_2_node @@ -149,7 +149,7 @@ SELECT nodeid AS worker_2_node FROM pg_dist_node WHERE nodeport=:worker_2_port \ -- BEGIN: Trigger 2-way local shard split copy. -- Ensure we will perform text copy. -SET citus.enable_binary_protocol = FALSE; +SET citus.enable_binary_protocol = false; SELECT * from worker_split_copy( 81070000, -- source shard id to copy ARRAY[ @@ -186,18 +186,18 @@ SELECT * from worker_split_copy( -- END: Trigger 2-way remote shard split copy. -- BEGIN: List updated row count for local targets shard. -SELECT COUNT(*) FROM worker_shard_text_copy_test.shard_to_split_copy_81070015; -SELECT COUNT(*) FROM worker_shard_text_copy_test.shard_to_split_copy_81070016; +SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070015; +SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070016; -- END: List updated row count for local targets shard. -- BEGIN: List updated row count for remote targets shard. \c - - - :worker_2_port -SELECT COUNT(*) FROM worker_shard_text_copy_test.shard_to_split_copy_81070015; -SELECT COUNT(*) FROM worker_shard_text_copy_test.shard_to_split_copy_81070016; +SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070015; +SELECT COUNT(*) FROM worker_split_text_copy_test.shard_to_split_copy_81070016; -- END: List updated row count for remote targets shard. -- BEGIN: CLEANUP. \c - - - :master_port SET client_min_messages TO WARNING; -DROP SCHEMA citus_split_shard_by_split_points_local CASCADE; +DROP SCHEMA worker_split_text_copy_test CASCADE; -- END: CLEANUP.