From 80d2bc2317def9232899030ccb2f88e87bb5dbbc Mon Sep 17 00:00:00 2001 From: Sait Talha Nisanci Date: Thu, 4 Jun 2020 10:00:25 +0300 Subject: [PATCH] normalize some output and sort test result --- src/test/regress/bin/normalize.sed | 5 +++- src/test/regress/expected/ch_bench_having.out | 6 ++--- .../foreign_key_restriction_enforcement.out | 24 ------------------- .../expected/insert_select_repartition.out | 1 - .../expected/intermediate_result_pruning.out | 4 ---- src/test/regress/sql/ch_bench_having.sql | 4 ++-- .../regress/sql/multi_mx_create_table.sql | 4 ++-- 7 files changed, 11 insertions(+), 37 deletions(-) diff --git a/src/test/regress/bin/normalize.sed b/src/test/regress/bin/normalize.sed index 80dfe2122..cd1866ea9 100644 --- a/src/test/regress/bin/normalize.sed +++ b/src/test/regress/bin/normalize.sed @@ -93,7 +93,10 @@ s/varattnosyn/varoattno/g /DEBUG: index ".*" can safely use deduplication.*$/d /DEBUG: index ".*" cannot use deduplication.*$/d /DEBUG: building index ".*" on table ".*" serially.*$/d - +s/partition ".*" would be violated by some row/partition would be violated by some row/g +/.*Peak Memory Usage:.*$/d +s/of relation ".*" contains null values/contains null values/g +s/of relation "t1" is violated by some row/is violated by some row/g # intermediate_results diff --git a/src/test/regress/expected/ch_bench_having.out b/src/test/regress/expected/ch_bench_having.out index 6c713a06e..29feb0305 100644 --- a/src/test/regress/expected/ch_bench_having.out +++ b/src/test/regress/expected/ch_bench_having.out @@ -335,11 +335,11 @@ having sum(s_order_cnt) > where mod((s_w_id * s_i_id),10000) = s_suppkey and s_nationkey = n_nationkey and n_name = 'GERMANY') -order by ordercount desc; +order by s_i_id, ordercount desc; s_i_id | ordercount --------------------------------------------------------------------- - 33 | 1 1 | 1 + 33 | 1 (2 rows) insert into stock VALUES @@ -356,7 +356,7 @@ having sum(s_order_cnt) > where mod((s_w_id * s_i_id),10000) = s_suppkey and s_nationkey = n_nationkey and n_name = 'GERMANY') -order by ordercount desc; +order by s_i_id, ordercount desc; s_i_id | ordercount --------------------------------------------------------------------- 1 | 100001 diff --git a/src/test/regress/expected/foreign_key_restriction_enforcement.out b/src/test/regress/expected/foreign_key_restriction_enforcement.out index 0fa3ad4eb..d7b147370 100644 --- a/src/test/regress/expected/foreign_key_restriction_enforcement.out +++ b/src/test/regress/expected/foreign_key_restriction_enforcement.out @@ -192,7 +192,6 @@ BEGIN; ALTER TABLE on_update_fkey_table ALTER COLUMN value_1 SET DATA TYPE bigint; DEBUG: rewriting table "on_update_fkey_table" -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially DEBUG: validating foreign key constraint "fkey" ROLLBACK; BEGIN; @@ -204,7 +203,6 @@ BEGIN; ALTER TABLE on_update_fkey_table ALTER COLUMN value_1 SET DATA TYPE bigint; DEBUG: rewriting table "on_update_fkey_table" -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially DEBUG: validating foreign key constraint "fkey" ROLLBACK; -- case 1.6: SELECT to a reference table is followed by an unrelated DDL @@ -488,7 +486,6 @@ DEBUG: switching to sequential query execution mode DETAIL: Reference table "reference_table" is modified, which might lead to data inconsistencies or distributed deadlocks via parallel accesses to hash distributed tables due to foreign keys. Any parallel modification to those hash distributed tables in the same transaction can only be executed in sequential query execution mode ALTER TABLE on_update_fkey_table ALTER COLUMN value_1 SET DATA TYPE bigint; DEBUG: rewriting table "on_update_fkey_table" -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially DEBUG: validating foreign key constraint "fkey" ROLLBACK; BEGIN; @@ -497,7 +494,6 @@ DEBUG: switching to sequential query execution mode DETAIL: Reference table "transitive_reference_table" is modified, which might lead to data inconsistencies or distributed deadlocks via parallel accesses to hash distributed tables due to foreign keys. Any parallel modification to those hash distributed tables in the same transaction can only be executed in sequential query execution mode ALTER TABLE on_update_fkey_table ALTER COLUMN value_1 SET DATA TYPE bigint; DEBUG: rewriting table "on_update_fkey_table" -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially DEBUG: validating foreign key constraint "fkey" ROLLBACK; -- case 2.6: UPDATE to a reference table is followed by an unrelated DDL @@ -534,14 +530,12 @@ BEGIN; DEBUG: switching to sequential query execution mode DETAIL: Reference table "reference_table" is modified, which might lead to data inconsistencies or distributed deadlocks via parallel accesses to hash distributed tables due to foreign keys. Any parallel modification to those hash distributed tables in the same transaction can only be executed in sequential query execution mode TRUNCATE on_update_fkey_table; -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially ROLLBACK; BEGIN; UPDATE transitive_reference_table SET id = 101 WHERE id = 99; DEBUG: switching to sequential query execution mode DETAIL: Reference table "transitive_reference_table" is modified, which might lead to data inconsistencies or distributed deadlocks via parallel accesses to hash distributed tables due to foreign keys. Any parallel modification to those hash distributed tables in the same transaction can only be executed in sequential query execution mode TRUNCATE on_update_fkey_table; -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially ROLLBACK; -- case 3.1: an unrelated DDL to a reference table is followed by a real-time SELECT BEGIN; @@ -621,38 +615,30 @@ ROLLBACK; BEGIN; ALTER TABLE reference_table ALTER COLUMN id SET DATA TYPE smallint; DEBUG: rewriting table "reference_table" -DEBUG: building index "reference_table_pkey" on table "reference_table" serially DEBUG: validating foreign key constraint "fkey" CREATE INDEX fkey_test_index_1 ON on_update_fkey_table(value_1); -DEBUG: building index "fkey_test_index_1" on table "on_update_fkey_table" serially ROLLBACK; BEGIN; ALTER TABLE transitive_reference_table ALTER COLUMN id SET DATA TYPE smallint; DEBUG: rewriting table "transitive_reference_table" -DEBUG: building index "transitive_reference_table_pkey" on table "transitive_reference_table" serially DEBUG: validating foreign key constraint "fkey" CREATE INDEX fkey_test_index_1 ON on_update_fkey_table(value_1); -DEBUG: building index "fkey_test_index_1" on table "on_update_fkey_table" serially ROLLBACK; -- case 4.6: DDL to reference table followed by a DDL to dist table, both touching fkey columns BEGIN; ALTER TABLE reference_table ALTER COLUMN id SET DATA TYPE smallint; DEBUG: rewriting table "reference_table" -DEBUG: building index "reference_table_pkey" on table "reference_table" serially DEBUG: validating foreign key constraint "fkey" ALTER TABLE on_update_fkey_table ALTER COLUMN value_1 SET DATA TYPE smallint; DEBUG: rewriting table "on_update_fkey_table" -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially DEBUG: validating foreign key constraint "fkey" ROLLBACK; BEGIN; ALTER TABLE transitive_reference_table ALTER COLUMN id SET DATA TYPE smallint; DEBUG: rewriting table "transitive_reference_table" -DEBUG: building index "transitive_reference_table_pkey" on table "transitive_reference_table" serially DEBUG: validating foreign key constraint "fkey" ALTER TABLE on_update_fkey_table ALTER COLUMN value_1 SET DATA TYPE smallint; DEBUG: rewriting table "on_update_fkey_table" -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially DEBUG: validating foreign key constraint "fkey" ROLLBACK; -- case 3.7: DDL to a reference table is followed by COPY @@ -674,31 +660,25 @@ BEGIN; DEBUG: switching to sequential query execution mode DETAIL: Reference table "reference_table" is modified, which might lead to data inconsistencies or distributed deadlocks via parallel accesses to hash distributed tables due to foreign keys. Any parallel modification to those hash distributed tables in the same transaction can only be executed in sequential query execution mode TRUNCATE on_update_fkey_table; -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially ROLLBACK; BEGIN; ALTER TABLE transitive_reference_table ADD COLUMN X int; DEBUG: switching to sequential query execution mode DETAIL: Reference table "transitive_reference_table" is modified, which might lead to data inconsistencies or distributed deadlocks via parallel accesses to hash distributed tables due to foreign keys. Any parallel modification to those hash distributed tables in the same transaction can only be executed in sequential query execution mode TRUNCATE on_update_fkey_table; -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially ROLLBACK; -- case 3.9: DDL to a reference table is followed by TRUNCATE BEGIN; ALTER TABLE reference_table ALTER COLUMN id SET DATA TYPE smallint; DEBUG: rewriting table "reference_table" -DEBUG: building index "reference_table_pkey" on table "reference_table" serially DEBUG: validating foreign key constraint "fkey" TRUNCATE on_update_fkey_table; -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially ROLLBACK; BEGIN; ALTER TABLE transitive_reference_table ALTER COLUMN id SET DATA TYPE smallint; DEBUG: rewriting table "transitive_reference_table" -DEBUG: building index "transitive_reference_table_pkey" on table "transitive_reference_table" serially DEBUG: validating foreign key constraint "fkey" TRUNCATE on_update_fkey_table; -DEBUG: building index "on_update_fkey_table_pkey" on table "on_update_fkey_table" serially ROLLBACK; --------------------------------------------------------------------- --- Now, start testing the other way araound @@ -790,7 +770,6 @@ BEGIN; ALTER TABLE reference_table ALTER COLUMN id SET DATA TYPE smallint; DEBUG: rewriting table "reference_table" -DEBUG: building index "reference_table_pkey" on table "reference_table" serially DEBUG: validating foreign key constraint "fkey" ERROR: cannot execute DDL on reference table "reference_table" because there was a parallel SELECT access to distributed table "on_update_fkey_table" in the same transaction HINT: Try re-running the transaction with "SET LOCAL citus.multi_shard_modify_mode TO 'sequential';" @@ -804,7 +783,6 @@ BEGIN; ALTER TABLE transitive_reference_table ALTER COLUMN id SET DATA TYPE smallint; DEBUG: rewriting table "transitive_reference_table" -DEBUG: building index "transitive_reference_table_pkey" on table "transitive_reference_table" serially DEBUG: validating foreign key constraint "fkey" ERROR: cannot execute DDL on reference table "transitive_reference_table" because there was a parallel SELECT access to distributed table "on_update_fkey_table" in the same transaction HINT: Try re-running the transaction with "SET LOCAL citus.multi_shard_modify_mode TO 'sequential';" @@ -1402,7 +1380,6 @@ SET client_min_messages TO DEBUG1; -- set the mode to sequential for the next operations CREATE TABLE reference_table(id int PRIMARY KEY); DEBUG: CREATE TABLE / PRIMARY KEY will create implicit index "reference_table_pkey" for table "reference_table" -DEBUG: building index "reference_table_pkey" on table "reference_table" serially SELECT create_reference_table('reference_table'); create_reference_table --------------------------------------------------------------------- @@ -1411,7 +1388,6 @@ SELECT create_reference_table('reference_table'); CREATE TABLE distributed_table(id int PRIMARY KEY, value_1 int); DEBUG: CREATE TABLE / PRIMARY KEY will create implicit index "distributed_table_pkey" for table "distributed_table" -DEBUG: building index "distributed_table_pkey" on table "distributed_table" serially SELECT create_distributed_table('distributed_table', 'id'); create_distributed_table --------------------------------------------------------------------- diff --git a/src/test/regress/expected/insert_select_repartition.out b/src/test/regress/expected/insert_select_repartition.out index 858d7a05d..8845e7001 100644 --- a/src/test/regress/expected/insert_select_repartition.out +++ b/src/test/regress/expected/insert_select_repartition.out @@ -274,7 +274,6 @@ TRUNCATE target_table; SET citus.log_remote_commands TO true; SET client_min_messages TO DEBUG; CREATE TABLE results AS SELECT max(-a), array_agg(mapped_key) FROM source_table GROUP BY a; DEBUG: Router planner cannot handle multi-shard select queries -DEBUG: building index "pg_toast_xxxxx_index" on table "pg_toast_xxxxx" serially NOTICE: issuing SELECT max((OPERATOR(pg_catalog.-) a)) AS max, array_agg(mapped_key) AS array_agg, a AS worker_column_3 FROM insert_select_repartition.source_table_4213601 source_table WHERE true GROUP BY a NOTICE: issuing SELECT max((OPERATOR(pg_catalog.-) a)) AS max, array_agg(mapped_key) AS array_agg, a AS worker_column_3 FROM insert_select_repartition.source_table_4213602 source_table WHERE true GROUP BY a NOTICE: issuing SELECT max((OPERATOR(pg_catalog.-) a)) AS max, array_agg(mapped_key) AS array_agg, a AS worker_column_3 FROM insert_select_repartition.source_table_4213603 source_table WHERE true GROUP BY a diff --git a/src/test/regress/expected/intermediate_result_pruning.out b/src/test/regress/expected/intermediate_result_pruning.out index c265a7c9b..dbf6acc02 100644 --- a/src/test/regress/expected/intermediate_result_pruning.out +++ b/src/test/regress/expected/intermediate_result_pruning.out @@ -935,13 +935,9 @@ DEBUG: Subplan XXX_1 will be sent to localhost:xxxxx -- test case for issue #3556 CREATE TABLE accounts (id text PRIMARY KEY); -DEBUG: building index "pg_toast_xxxxx_index" on table "pg_toast_xxxxx" serially DEBUG: CREATE TABLE / PRIMARY KEY will create implicit index "accounts_pkey" for table "accounts" -DEBUG: building index "accounts_pkey" on table "accounts" serially CREATE TABLE stats (account_id text PRIMARY KEY, spent int); -DEBUG: building index "pg_toast_xxxxx_index" on table "pg_toast_xxxxx" serially DEBUG: CREATE TABLE / PRIMARY KEY will create implicit index "stats_pkey" for table "stats" -DEBUG: building index "stats_pkey" on table "stats" serially SELECT create_distributed_table('accounts', 'id', colocate_with => 'none'); create_distributed_table --------------------------------------------------------------------- diff --git a/src/test/regress/sql/ch_bench_having.sql b/src/test/regress/sql/ch_bench_having.sql index 890e6a3a2..b6996cbe3 100644 --- a/src/test/regress/sql/ch_bench_having.sql +++ b/src/test/regress/sql/ch_bench_having.sql @@ -159,7 +159,7 @@ having sum(s_order_cnt) > where mod((s_w_id * s_i_id),10000) = s_suppkey and s_nationkey = n_nationkey and n_name = 'GERMANY') -order by ordercount desc; +order by s_i_id, ordercount desc; insert into stock VALUES (10033, 1, 1, 1, 100000, 1, '', '','','','','','','','','',''); @@ -176,7 +176,7 @@ having sum(s_order_cnt) > where mod((s_w_id * s_i_id),10000) = s_suppkey and s_nationkey = n_nationkey and n_name = 'GERMANY') -order by ordercount desc; +order by s_i_id, ordercount desc; BEGIN; SET LOCAL client_min_messages TO WARNING; diff --git a/src/test/regress/sql/multi_mx_create_table.sql b/src/test/regress/sql/multi_mx_create_table.sql index da16122f2..cb5316f91 100644 --- a/src/test/regress/sql/multi_mx_create_table.sql +++ b/src/test/regress/sql/multi_mx_create_table.sql @@ -261,10 +261,10 @@ CREATE TABLE lineitem_mx ( l_shipmode char(10) not null, l_comment varchar(44) not null, PRIMARY KEY(l_orderkey, l_linenumber) ); - -SET citus.shard_count TO 16; SELECT create_distributed_table('lineitem_mx', 'l_orderkey'); +-- SET citus.shard_count TO 16; + CREATE INDEX lineitem_mx_time_index ON lineitem_mx (l_shipdate); CREATE TABLE orders_mx (