From 69cf83ca223ac825372718fc28b7610a54e4034b Mon Sep 17 00:00:00 2001 From: Burak Velioglu Date: Wed, 13 Apr 2022 00:05:11 +0300 Subject: [PATCH] Continue fixing multi tests --- .../alter_table_set_access_method.out | 23 +++++++++++++ .../regress/expected/multi_partitioning.out | 2 ++ .../expected/non_colocated_subquery_joins.out | 3 +- .../expected/object_propagation_debug.out | 3 +- .../expected/recursive_view_local_table.out | 3 ++ src/test/regress/expected/set_operations.out | 6 ++++ .../expected/subquery_in_targetlist.out | 4 +++ .../regress/expected/subquery_in_where.out | 2 ++ .../expected/subquery_partitioning.out | 3 ++ src/test/regress/expected/subquery_view.out | 34 +++++++++++++++++++ .../regress/expected/undistribute_table.out | 19 +++++++++++ src/test/regress/expected/union_pushdown.out | 3 ++ .../sql/alter_table_set_access_method.sql | 10 ++++-- .../sql/non_colocated_subquery_joins.sql | 3 +- 14 files changed, 113 insertions(+), 5 deletions(-) diff --git a/src/test/regress/expected/alter_table_set_access_method.out b/src/test/regress/expected/alter_table_set_access_method.out index 75ddac37e..ccd3a98f5 100644 --- a/src/test/regress/expected/alter_table_set_access_method.out +++ b/src/test/regress/expected/alter_table_set_access_method.out @@ -575,6 +575,9 @@ CREATE TABLE local(a int, b bigserial, c int default nextval('c_seq')); INSERT INTO local VALUES (3); create materialized view m_local as select * from local; create view v_local as select * from local; +WARNING: "view v_local" has dependency to "table local" that is not in Citus' metadata +DETAIL: "view v_local" will be created only locally +HINT: Distribute "table local" first to distribute "view v_local" CREATE TABLE ref(a int); SELECT create_Reference_table('ref'); create_reference_table @@ -604,6 +607,13 @@ DETAIL: drop cascades to materialized view m_local drop cascades to view v_local CONTEXT: SQL statement "DROP TABLE alter_table_set_access_method.local CASCADE" NOTICE: renaming the new table to alter_table_set_access_method.local +WARNING: "view v_local" has dependency to "table local" that is not in Citus' metadata +DETAIL: "view v_local" will be created only locally +HINT: Distribute "table local" first to distribute "view v_local" +CONTEXT: SQL statement "CREATE VIEW alter_table_set_access_method.v_local AS SELECT local.a, + local.b, + local.c + FROM local;" alter_table_set_access_method --------------------------------------------------------------------- @@ -623,6 +633,8 @@ NOTICE: renaming the new table to alter_table_set_access_method.ref (1 row) +-- (TODO: CHECK) Since there is a dependent view, we must use sequential mode +SET citus.multi_shard_modify_mode TO 'sequential'; select alter_table_set_access_method('dist','columnar'); NOTICE: creating a new table for alter_table_set_access_method.dist NOTICE: moving the data of alter_table_set_access_method.dist @@ -651,6 +663,7 @@ NOTICE: renaming the new table to alter_table_set_access_method.dist (1 row) +RESET citus.multi_shard_modify_mode; select alter_table_set_access_method('local','heap'); NOTICE: creating a new table for alter_table_set_access_method.local NOTICE: moving the data of alter_table_set_access_method.local @@ -660,6 +673,13 @@ DETAIL: drop cascades to materialized view m_local drop cascades to view v_local CONTEXT: SQL statement "DROP TABLE alter_table_set_access_method.local CASCADE" NOTICE: renaming the new table to alter_table_set_access_method.local +WARNING: "view v_local" has dependency to "table local" that is not in Citus' metadata +DETAIL: "view v_local" will be created only locally +HINT: Distribute "table local" first to distribute "view v_local" +CONTEXT: SQL statement "CREATE VIEW alter_table_set_access_method.v_local AS SELECT local.a, + local.b, + local.c + FROM local;" alter_table_set_access_method --------------------------------------------------------------------- @@ -679,6 +699,8 @@ NOTICE: renaming the new table to alter_table_set_access_method.ref (1 row) +-- (TODO: CHECK) Since there is a dependent view, we must use sequential mode +SET citus.multi_shard_modify_mode TO 'sequential'; select alter_table_set_access_method('dist','heap'); NOTICE: creating a new table for alter_table_set_access_method.dist NOTICE: moving the data of alter_table_set_access_method.dist @@ -693,6 +715,7 @@ NOTICE: renaming the new table to alter_table_set_access_method.dist (1 row) +RESET citus.multi_shard_modify_mode; SELECT * FROM m_local; a | b | c --------------------------------------------------------------------- diff --git a/src/test/regress/expected/multi_partitioning.out b/src/test/regress/expected/multi_partitioning.out index a2c03ef7a..3d972f710 100644 --- a/src/test/regress/expected/multi_partitioning.out +++ b/src/test/regress/expected/multi_partitioning.out @@ -4302,6 +4302,8 @@ WHERE schemaname = 'partitioning_schema' AND tablename ilike '%part_table_with_% -- should work properly - no names clashes SELECT 1 FROM citus_activate_node('localhost', :worker_1_port); +NOTICE: Replicating postgres objects to node localhost:xxxxx +DETAIL: There are 106 objects to replicate, depending on your environment this might take a while ?column? --------------------------------------------------------------------- 1 diff --git a/src/test/regress/expected/non_colocated_subquery_joins.out b/src/test/regress/expected/non_colocated_subquery_joins.out index c14502569..b19d1c405 100644 --- a/src/test/regress/expected/non_colocated_subquery_joins.out +++ b/src/test/regress/expected/non_colocated_subquery_joins.out @@ -1076,7 +1076,6 @@ ERROR: cannot pushdown the subquery -- make sure that non-colocated subquery joins work fine in -- modifications CREATE TABLE table1 (id int, tenant_id int); -CREATE VIEW table1_view AS SELECT * from table1 where id < 100; CREATE TABLE table2 (id int, tenant_id int) partition by range(tenant_id); CREATE TABLE table2_p1 PARTITION OF table2 FOR VALUES FROM (1) TO (10); -- modifications on the partitons are only allowed with rep=1 @@ -1093,6 +1092,8 @@ SELECT create_distributed_table('table1','tenant_id'); (1 row) +CREATE VIEW table1_view AS SELECT * from table1 where id < 100; +DEBUG: switching to sequential query execution mode -- all of the above queries are non-colocated subquery joins -- because the views are replaced with subqueries UPDATE table2 SET id=20 FROM table1_view WHERE table1_view.id=table2.id; diff --git a/src/test/regress/expected/object_propagation_debug.out b/src/test/regress/expected/object_propagation_debug.out index 020fa2629..8cecb1c85 100644 --- a/src/test/regress/expected/object_propagation_debug.out +++ b/src/test/regress/expected/object_propagation_debug.out @@ -50,8 +50,9 @@ ON TRUE --------------------------------------------------------------------- ("composite type","""object prop""",t1,"""object prop"".t1") (schema,,"""object prop""","""object prop""") + (table,"""object prop""",test,"""object prop"".test") (type,"""object prop""",t1,"""object prop"".t1") -(3 rows) +(4 rows) -- find all the dependencies of type t1 SELECT diff --git a/src/test/regress/expected/recursive_view_local_table.out b/src/test/regress/expected/recursive_view_local_table.out index a2306a2e9..b4ef802b4 100644 --- a/src/test/regress/expected/recursive_view_local_table.out +++ b/src/test/regress/expected/recursive_view_local_table.out @@ -12,6 +12,9 @@ CREATE RECURSIVE VIEW recursive_view(val_1, val_2) AS WHERE val_2 < 50 ); CREATE RECURSIVE VIEW recursive_defined_non_recursive_view(c) AS (SELECT 1 FROM local_table); +WARNING: "view recursive_defined_non_recursive_view" has dependency to "table local_table" that is not in Citus' metadata +DETAIL: "view recursive_defined_non_recursive_view" will be created only locally +HINT: Distribute "table local_table" first to distribute "view recursive_defined_non_recursive_view" CREATE TABLE ref_table(a int, b INT); SELECT create_reference_table('ref_table'); create_reference_table diff --git a/src/test/regress/expected/set_operations.out b/src/test/regress/expected/set_operations.out index 63abfe578..ea25f8101 100644 --- a/src/test/regress/expected/set_operations.out +++ b/src/test/regress/expected/set_operations.out @@ -978,6 +978,8 @@ DEBUG: Creating router plan SET citus.enable_repartition_joins TO OFF; -- this should be recursively planned CREATE VIEW set_view_recursive AS (SELECT y FROM test) UNION (SELECT y FROM test); +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM set_view_recursive ORDER BY 1 DESC; DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries @@ -996,6 +998,8 @@ DEBUG: Creating router plan -- this should be pushed down CREATE VIEW set_view_pushdown AS (SELECT x FROM test) UNION (SELECT x FROM test); +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM set_view_pushdown ORDER BY 1 DESC; DEBUG: Router planner cannot handle multi-shard select queries x @@ -1006,6 +1010,8 @@ DEBUG: Router planner cannot handle multi-shard select queries -- this should be recursively planned CREATE VIEW set_view_recursive_second AS SELECT u.x, test.y FROM ((SELECT x, y FROM test) UNION (SELECT 1, 1 FROM test)) u JOIN test USING (x) ORDER BY 1,2; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM set_view_recursive_second ORDER BY 1,2; DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries diff --git a/src/test/regress/expected/subquery_in_targetlist.out b/src/test/regress/expected/subquery_in_targetlist.out index a32b480f1..79989b409 100644 --- a/src/test/regress/expected/subquery_in_targetlist.out +++ b/src/test/regress/expected/subquery_in_targetlist.out @@ -278,6 +278,8 @@ ORDER BY 1 LIMIT 3; ERROR: correlated subqueries are not supported when the FROM clause contains a subquery without FROM -- sublink on view CREATE TEMP VIEW view_1 AS (SELECT user_id, value_2 FROM users_table WHERE user_id = 1 AND value_1 = 1 ORDER BY 1,2); +WARNING: "view view_1" has dependency on unsupported object "schema pg_temp_xxx" +DETAIL: "view view_1" will be created only locally -- with distribution column group by SELECT (SELECT value_2 FROM view_1 WHERE user_id = e.user_id GROUP BY user_id, value_2) FROM events_table e @@ -323,6 +325,8 @@ ORDER BY 1 LIMIT 3; -- sublink on reference table view CREATE TEMP VIEW view_2 AS (SELECT user_id, value_2 FROM users_reference_table WHERE user_id = 1 AND value_1 = 1); +WARNING: "view view_2" has dependency on unsupported object "schema pg_temp_xxx" +DETAIL: "view view_2" will be created only locally SELECT (SELECT value_2 FROM view_2 WHERE user_id = e.user_id GROUP BY user_id, value_2) FROM events_table e GROUP BY 1 diff --git a/src/test/regress/expected/subquery_in_where.out b/src/test/regress/expected/subquery_in_where.out index c5aedd31d..c5ffc8d93 100644 --- a/src/test/regress/expected/subquery_in_where.out +++ b/src/test/regress/expected/subquery_in_where.out @@ -1096,6 +1096,8 @@ CREATE TEMPORARY VIEW correlated_subquery_view AS FROM events_table e1 WHERE e1.user_id = u1.user_id ) > 0; +WARNING: "view correlated_subquery_view" has dependency on unsupported object "schema pg_temp_xxx" +DETAIL: "view correlated_subquery_view" will be created only locally SELECT sum(user_id) FROM correlated_subquery_view; sum --------------------------------------------------------------------- diff --git a/src/test/regress/expected/subquery_partitioning.out b/src/test/regress/expected/subquery_partitioning.out index 80ea4478a..57a589600 100644 --- a/src/test/regress/expected/subquery_partitioning.out +++ b/src/test/regress/expected/subquery_partitioning.out @@ -209,6 +209,9 @@ FROM ) as foo WHERE foo.user_id = cte.user_id ) as foo, users_table WHERE foo.cnt > users_table.value_2; +WARNING: "view subquery_and_ctes" has dependency to "table users_table_local" that is not in Citus' metadata +DETAIL: "view subquery_and_ctes" will be created only locally +HINT: Distribute "table users_table_local" first to distribute "view subquery_and_ctes" SELECT * FROM subquery_and_ctes ORDER BY 3 DESC, 1 DESC, 2 DESC, 4 DESC LIMIT 5; diff --git a/src/test/regress/expected/subquery_view.out b/src/test/regress/expected/subquery_view.out index 5f50e6e6d..4c7680908 100644 --- a/src/test/regress/expected/subquery_view.out +++ b/src/test/regress/expected/subquery_view.out @@ -16,6 +16,8 @@ SELECT users_table.user_id = events_table.user_id AND event_type IN (1,2,3,4) ORDER BY 1 DESC; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM @@ -42,6 +44,8 @@ SELECT event_type IN (1,2,3,4) ORDER BY 1 DESC LIMIT 5; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM @@ -74,6 +78,8 @@ FROM ORDER BY 1 DESC LIMIT 5 ) as foo ORDER BY 1 DESC; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM subquery_limit ORDER BY 1 DESC; DEBUG: push down of limit count: 5 DEBUG: generating subplan XXX_1 for subquery SELECT DISTINCT users_table.user_id FROM public.users_table, public.events_table WHERE ((users_table.user_id OPERATOR(pg_catalog.=) events_table.user_id) AND (events_table.event_type OPERATOR(pg_catalog.=) ANY (ARRAY[1, 2, 3, 4]))) ORDER BY users_table.user_id DESC LIMIT 5 @@ -102,6 +108,8 @@ FROM ORDER BY 1 ) as foo ORDER BY 1 DESC; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM subquery_non_p_key_group_by ORDER BY 1 DESC; DEBUG: generating subplan XXX_1 for subquery SELECT DISTINCT users_table.value_1 FROM public.users_table, public.events_table WHERE ((users_table.user_id OPERATOR(pg_catalog.=) events_table.user_id) AND (events_table.event_type OPERATOR(pg_catalog.=) ANY (ARRAY[1, 2, 3, 4]))) ORDER BY users_table.value_1 DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT value_1 FROM (SELECT foo.value_1 FROM (SELECT intermediate_result.value_1 FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(value_1 integer)) foo ORDER BY foo.value_1 DESC) subquery_non_p_key_group_by ORDER BY value_1 DESC @@ -141,6 +149,8 @@ FROM ) as bar WHERE foo.value_2 = bar.value_3 ORDER BY 2 DESC, 1; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM final_query_router ORDER BY 1; DEBUG: generating subplan XXX_1 for subquery SELECT users_table.value_2 FROM public.users_table, public.events_table WHERE ((users_table.user_id OPERATOR(pg_catalog.=) events_table.user_id) AND (events_table.event_type OPERATOR(pg_catalog.=) ANY (ARRAY[1, 2, 3, 4]))) GROUP BY users_table.value_2 ORDER BY users_table.value_2 DESC DEBUG: generating subplan XXX_2 for subquery SELECT users_table.value_3 FROM public.users_table, public.events_table WHERE ((users_table.user_id OPERATOR(pg_catalog.=) events_table.user_id) AND (events_table.event_type OPERATOR(pg_catalog.=) ANY (ARRAY[5, 6, 7, 8]))) GROUP BY users_table.value_3 ORDER BY users_table.value_3 DESC @@ -181,6 +191,8 @@ FROM WHERE foo.value_2 = bar.user_id ORDER BY 2 DESC, 1 DESC LIMIT 3; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT DISTINCT ON (users_table.value_2) users_table.value_2, time, value_3 FROM @@ -206,6 +218,8 @@ SELECT DISTINCT user_id FROM users_table WHERE user_id IN (SELECT DISTINCT value_2 FROM users_table WHERE value_1 >= 1 AND value_1 <= 20 ORDER BY 1 LIMIT 5); +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM @@ -248,6 +262,8 @@ FROM ( ) t GROUP BY user_id ) q; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM @@ -281,6 +297,9 @@ FROM ) as baz WHERE baz.user_id = users_table.user_id ) as sub1; +WARNING: "view subquery_from_from_where_local_table" has dependency to "table events_table_local" that is not in Citus' metadata +DETAIL: "view subquery_from_from_where_local_table" will be created only locally +HINT: Distribute "table events_table_local" first to distribute "view subquery_from_from_where_local_table" SELECT * FROM @@ -308,6 +327,8 @@ FROM SELECT user_id FROM users_table ) as bar WHERE foo.value_2 = bar.user_id; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM @@ -337,6 +358,9 @@ FROM SELECT user_id FROM users_table_local WHERE user_id = 2 ) baw WHERE foo.value_2 = bar.user_id AND baz.value_2 = bar.user_id AND bar.user_id = baw.user_id; +WARNING: "view all_executors_view" has dependency to "table users_table_local" that is not in Citus' metadata +DETAIL: "view all_executors_view" will be created only locally +HINT: Distribute "table users_table_local" first to distribute "view all_executors_view" SELECT * FROM @@ -390,6 +414,9 @@ FROM ) as foo WHERE foo.user_id = cte.user_id ) as foo, users_table WHERE foo.cnt > users_table.value_2; +WARNING: "view subquery_and_ctes" has dependency to "table users_table_local" that is not in Citus' metadata +DETAIL: "view subquery_and_ctes" will be created only locally +HINT: Distribute "table users_table_local" first to distribute "view subquery_and_ctes" SELECT * FROM subquery_and_ctes ORDER BY 3 DESC, 1 DESC, 2 DESC, 4 DESC LIMIT 5; @@ -437,6 +464,9 @@ SELECT time, event_type, value_2, value_3 FROM events_table WHERE foo.user_id = events_table.value_2; +WARNING: "view subquery_and_ctes_second" has dependency to "table users_table_local" that is not in Citus' metadata +DETAIL: "view subquery_and_ctes_second" will be created only locally +HINT: Distribute "table users_table_local" first to distribute "view subquery_and_ctes_second" SELECT * FROM subquery_and_ctes_second ORDER BY 3 DESC, 2 DESC, 1 DESC LIMIT 5; @@ -499,6 +529,8 @@ FROM ) as level_6, users_table WHERE users_table.user_id = level_6.min GROUP BY users_table.value_1 ) as bar; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM @@ -530,6 +562,8 @@ FROM ORDER BY 1 DESC LIMIT 5 ) as foo ORDER BY 1 DESC; +DEBUG: switching to sequential query execution mode +DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands SELECT * FROM diff --git a/src/test/regress/expected/undistribute_table.out b/src/test/regress/expected/undistribute_table.out index 5b646da32..e3f1c6271 100644 --- a/src/test/regress/expected/undistribute_table.out +++ b/src/test/regress/expected/undistribute_table.out @@ -340,6 +340,25 @@ drop cascades to view undis_view2 drop cascades to view another_schema.undis_view3 CONTEXT: SQL statement "DROP TABLE undistribute_table.view_table CASCADE" NOTICE: renaming the new table to undistribute_table.view_table +WARNING: "view undis_view1" has dependency to "table view_table" that is not in Citus' metadata +DETAIL: "view undis_view1" will be created only locally +HINT: Distribute "table view_table" first to distribute "view undis_view1" +CONTEXT: SQL statement "CREATE VIEW undistribute_table.undis_view1 AS SELECT view_table.a, + view_table.b + FROM view_table;" +WARNING: "view undis_view2" has dependency to "table view_table" that is not in Citus' metadata +DETAIL: "view undis_view2" will be created only locally +HINT: Distribute "table view_table" first to distribute "view undis_view2" +CONTEXT: SQL statement "CREATE VIEW undistribute_table.undis_view2 AS SELECT view_table.a, + view_table.c + FROM view_table;" +WARNING: "view another_schema.undis_view3" has dependency to "table view_table" that is not in Citus' metadata +DETAIL: "view another_schema.undis_view3" will be created only locally +HINT: Distribute "table view_table" first to distribute "view another_schema.undis_view3" +CONTEXT: SQL statement "CREATE VIEW another_schema.undis_view3 AS SELECT undis_view1.b, + undis_view2.c + FROM (undis_view1 + JOIN undis_view2 ON ((undis_view1.a = undis_view2.a)));" undistribute_table --------------------------------------------------------------------- diff --git a/src/test/regress/expected/union_pushdown.out b/src/test/regress/expected/union_pushdown.out index 3d68bd8a5..cbee11f8e 100644 --- a/src/test/regress/expected/union_pushdown.out +++ b/src/test/regress/expected/union_pushdown.out @@ -899,6 +899,9 @@ INSERT INTO range_dist_table_2 VALUES ((10, 91)); INSERT INTO range_dist_table_2 VALUES ((20, 100)); -- the following can be pushed down CREATE OR REPLACE VIEW v2 AS SELECT * from range_dist_table_2 UNION ALL SELECT * from range_dist_table_2; +WARNING: "view v2" has dependency to "table range_dist_table_2" that is not in Citus' metadata +DETAIL: "view v2" will be created only locally +HINT: Distribute "table range_dist_table_2" first to distribute "view v2" SELECT public.explain_has_distributed_subplan($$ EXPLAIN SELECT COUNT(dist_col) FROM v2; diff --git a/src/test/regress/sql/alter_table_set_access_method.sql b/src/test/regress/sql/alter_table_set_access_method.sql index 7ddadc531..0ff88cfd8 100644 --- a/src/test/regress/sql/alter_table_set_access_method.sql +++ b/src/test/regress/sql/alter_table_set_access_method.sql @@ -222,14 +222,20 @@ create view v_dist as select * from dist; select alter_table_set_access_method('local','columnar'); select alter_table_set_access_method('ref','columnar'); + +-- (TODO: CHECK) Since there is a dependent view, we must use sequential mode +SET citus.multi_shard_modify_mode TO 'sequential'; select alter_table_set_access_method('dist','columnar'); - - SELECT alter_distributed_table('dist', shard_count:=1, cascade_to_colocated:=false); +RESET citus.multi_shard_modify_mode; select alter_table_set_access_method('local','heap'); select alter_table_set_access_method('ref','heap'); + +-- (TODO: CHECK) Since there is a dependent view, we must use sequential mode +SET citus.multi_shard_modify_mode TO 'sequential'; select alter_table_set_access_method('dist','heap'); +RESET citus.multi_shard_modify_mode; SELECT * FROM m_local; SELECT * FROM m_ref; diff --git a/src/test/regress/sql/non_colocated_subquery_joins.sql b/src/test/regress/sql/non_colocated_subquery_joins.sql index d8a2aaea1..0c8953d2c 100644 --- a/src/test/regress/sql/non_colocated_subquery_joins.sql +++ b/src/test/regress/sql/non_colocated_subquery_joins.sql @@ -785,7 +785,6 @@ SELECT count(*) FROM events_table WHERE user_id NOT IN -- make sure that non-colocated subquery joins work fine in -- modifications CREATE TABLE table1 (id int, tenant_id int); -CREATE VIEW table1_view AS SELECT * from table1 where id < 100; CREATE TABLE table2 (id int, tenant_id int) partition by range(tenant_id); CREATE TABLE table2_p1 PARTITION OF table2 FOR VALUES FROM (1) TO (10); @@ -795,6 +794,8 @@ SET citus.shard_replication_factor TO 1; SELECT create_distributed_table('table2','tenant_id'); SELECT create_distributed_table('table1','tenant_id'); +CREATE VIEW table1_view AS SELECT * from table1 where id < 100; + -- all of the above queries are non-colocated subquery joins -- because the views are replaced with subqueries UPDATE table2 SET id=20 FROM table1_view WHERE table1_view.id=table2.id;