Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/test/regress/bin/normalize.sed
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,11 @@ s/^[[:space:]]*ERROR:[[:space:]]+could not connect to the publisher:[[:space:]]*
# can be removed when dropping pg17 support
s/(:varnullingrels \(b\) :varlevelsup 0) (:varnosyn 1)/\1 :varreturningtype 0 \2/g
# end pg18 varreturningtype

# The two relation names in the "<x> and <y> are not colocated" error detail
# can be printed in either order depending on the Citus version that produced
# the message. Citus #8319 made newer versions print the names in sorted order,
# but older versions (and therefore mixed-version regression runs) still print
# them in a nondeterministic order. Normalize both names so the order of the
# two relations never causes spurious diffs. See issue #8275.
s/^DETAIL: [a-zA-Z0-9_]+ and [a-zA-Z0-9_]+ are not colocated$/DETAIL: <relation> and <relation> are not colocated/
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ DEBUG: cannot perform distributed INSERT INTO ... SELECT because the partition
DETAIL: The target table's partition column should correspond to a partition column in the subquery.
DEBUG: router planner does not support queries that reference non-colocated distributed tables
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t2 and nullkey_c2_t1 are not colocated
DETAIL: <relation> and <relation> are not colocated
INSERT INTO distributed_table_c1_t1 SELECT * FROM nullkey_c1_t1 UNION SELECT * FROM nullkey_c2_t1;
DEBUG: cannot perform distributed INSERT INTO ... SELECT because the partition columns in the source table and subquery do not match
DETAIL: The target table's partition column should correspond to a partition column in the subquery.
Expand Down Expand Up @@ -315,7 +315,7 @@ INSERT INTO reference_table SELECT nullkey_c1_t2.a, nullkey_c1_t2.b FROM nullkey
DEBUG: only reference tables may be queried when targeting a reference table with distributed INSERT ... SELECT
DEBUG: router planner does not support queries that reference non-colocated distributed tables
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t2 and nullkey_c2_t1 are not colocated
DETAIL: <relation> and <relation> are not colocated
-- use a distributed table
SET client_min_messages TO DEBUG1;
SET citus.enable_repartition_joins TO ON;
Expand Down
2 changes: 1 addition & 1 deletion src/test/regress/expected/join_pushdown.out
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ ORDER BY 1;
-- Full outer join with different distribution column types, should error out
SELECT * FROM test_table_1 full join test_table_2 using(id);
ERROR: cannot push down this subquery
DETAIL: test_table_1 and test_table_2 are not colocated
DETAIL: <relation> and <relation> are not colocated
-- Test when the non-distributed column has the value of NULL
INSERT INTO test_table_1 VALUES(7, NULL);
INSERT INTO test_table_2 VALUES(7, NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/test/regress/expected/multi_modifications.out
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ ERROR: complex joins are only supported when all distributed tables are co-loca
-- setting shard key to another var that's implied to be equal to shard key --
UPDATE dist_1 SET a = dist_non_colocated.a FROM dist_non_colocated WHERE dist_1.a = dist_non_colocated.a;
ERROR: cannot push down this subquery
DETAIL: dist_1 and dist_non_colocated are not colocated
DETAIL: <relation> and <relation> are not colocated
UPDATE dist_1 SET a = dist_2.b FROM dist_2 WHERE dist_1.a = dist_2.b;
ERROR: complex joins are only supported when all distributed tables are co-located and joined on their distribution columns
---- update: a more sophisticated example ----
Expand Down
2 changes: 1 addition & 1 deletion src/test/regress/expected/multi_shard_update_delete.out
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ SET value_2 = 5
FROM events_test_table_2
WHERE users_test_table.user_id = events_test_table_2.user_id;
ERROR: cannot push down this subquery
DETAIL: events_test_table_2 and users_test_table are not colocated
DETAIL: <relation> and <relation> are not colocated
-- Should error out due to multiple row return from subquery, but we can not get this information within
-- subquery pushdown planner. This query will be sent to worker with recursive planner.
\set VERBOSITY terse
Expand Down
24 changes: 12 additions & 12 deletions src/test/regress/expected/query_single_shard_table.out
Original file line number Diff line number Diff line change
Expand Up @@ -522,48 +522,48 @@ SELECT * FROM nullkey_c1_t1 LEFT JOIN nullkey_c2_t2 USING(a) ORDER BY 1,2,3 LIMI
DEBUG: router planner does not support queries that reference non-colocated distributed tables
DEBUG: push down of limit count: 4
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t1 and nullkey_c2_t2 are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT * FROM nullkey_c1_t1 FULL JOIN nullkey_c2_t2 USING(a) ORDER BY 1,2,3 LIMIT 4;
DEBUG: router planner does not support queries that reference non-colocated distributed tables
DEBUG: push down of limit count: 4
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t1 and nullkey_c2_t2 are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT * FROM nullkey_c1_t1 t1
LEFT JOIN LATERAL (
SELECT * FROM nullkey_c2_t2 t2 WHERE t2.b > t1.a
) q USING(a) ORDER BY 1,2,3 OFFSET 3 LIMIT 4;
DEBUG: router planner does not support queries that reference non-colocated distributed tables
DEBUG: push down of limit count: 7
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t1 and nullkey_c2_t2 are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT COUNT(*) FROM nullkey_c1_t1 t1
LEFT JOIN LATERAL (
SELECT * FROM nullkey_c2_t2 t2 WHERE t2.b > t1.a
) q USING(a);
DEBUG: router planner does not support queries that reference non-colocated distributed tables
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t1 and nullkey_c2_t2 are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT COUNT(*) FROM nullkey_c1_t1 t1
WHERE EXISTS (
SELECT * FROM nullkey_c2_t2 t2 WHERE t2.b > t1.a
);
DEBUG: router planner does not support queries that reference non-colocated distributed tables
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t1 and nullkey_c2_t2 are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT COUNT(*) FROM nullkey_c1_t1 t1
WHERE t1.b IN (
SELECT b+1 FROM nullkey_c2_t2 t2 WHERE t2.b = t1.a
);
DEBUG: router planner does not support queries that reference non-colocated distributed tables
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t1 and nullkey_c2_t2 are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT COUNT(*) FROM nullkey_c1_t1 t1
WHERE t1.b NOT IN (
SELECT a FROM nullkey_c2_t2 t2 WHERE t2.b > t1.a
);
DEBUG: router planner does not support queries that reference non-colocated distributed tables
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t1 and nullkey_c2_t2 are not colocated
DETAIL: <relation> and <relation> are not colocated
-- join with a reference table
SELECT COUNT(*) FROM nullkey_c1_t1, reference_table WHERE nullkey_c1_t1.a = reference_table.a;
DEBUG: Creating router plan
Expand Down Expand Up @@ -3009,14 +3009,14 @@ ORDER BY 1,2 LIMIT 1;
DEBUG: router planner does not support queries that reference non-colocated distributed tables
DEBUG: push down of limit count: 1
ERROR: cannot push down this subquery
DETAIL: non_colocated_events_table and users_table are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT event_type, (SELECT max(time) FROM users_table WHERE user_id = e.value_2)
FROM non_colocated_events_table e
ORDER BY 1,2 LIMIT 1;
DEBUG: router planner does not support queries that reference non-colocated distributed tables
DEBUG: push down of limit count: 1
ERROR: cannot push down this subquery
DETAIL: non_colocated_events_table and users_table are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT event_type, (SELECT max(time) FROM users_table)
FROM non_colocated_events_table e
ORDER BY 1,2 LIMIT 1;
Expand Down Expand Up @@ -3118,7 +3118,7 @@ ORDER BY 1 LIMIT 3;
DEBUG: router planner does not support queries that reference non-colocated distributed tables
DEBUG: push down of limit count: 3
ERROR: cannot push down this subquery
DETAIL: non_colocated_events_table and users_table are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT (SELECT (SELECT e.user_id + user_id) FROM users_reference_table WHERE user_id = e.user_id GROUP BY user_id)
FROM non_colocated_events_table e
GROUP BY 1
Expand Down Expand Up @@ -3169,7 +3169,7 @@ ORDER BY 1 LIMIT 3;
DEBUG: router planner does not support queries that reference non-colocated distributed tables
DEBUG: push down of limit count: 3
ERROR: cannot push down this subquery
DETAIL: non_colocated_events_table and users_table are not colocated
DETAIL: <relation> and <relation> are not colocated
SELECT
user_id, count(*)
FROM
Expand Down Expand Up @@ -3295,7 +3295,7 @@ DEBUG: generating subplan XXX_1 for subquery SELECT a FROM query_single_shard_t
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count, avg(a) AS avg FROM (SELECT table_0.a FROM (query_single_shard_table.nullkey_c1_t1 table_0 RIGHT JOIN (SELECT table_2.a FROM ((SELECT intermediate_result.a FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(a integer)) table_2 JOIN query_single_shard_table.nullkey_c2_t1 table_4 USING (a)) WHERE (table_4.a OPERATOR(pg_catalog.<) 8)) table_1 USING (a))) avgsub
DEBUG: router planner does not support queries that reference non-colocated distributed tables
ERROR: cannot push down this subquery
DETAIL: nullkey_c1_t1 and nullkey_c2_t1 are not colocated
DETAIL: <relation> and <relation> are not colocated
-- test nested exec
CREATE FUNCTION dist_query_single_shard(p_key int)
RETURNS bigint
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/expected/recurring_join_pushdown.out
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS c
-- Test that the join is not pushed down when we have non-colocated tables in the RHS
SELECT count(*) FROM r1 LEFT JOIN (SELECT d1.a, d3_not_colocated.b FROM d3_not_colocated FULL JOIN d1 ON d3_not_colocated.a = d1.a) AS t1 USING (a);
ERROR: cannot push down this subquery
DETAIL: d1 and d3_not_colocated are not colocated
DETAIL: <relation> and <relation> are not colocated
-- The same error with its RIGHT JOIN variant
SELECT count(*) FROM r1 LEFT JOIN (SELECT d1.a, d3_not_colocated.b FROM d3_not_colocated JOIN d1 ON d3_not_colocated.a = d1.a) AS t1 USING (a);
ERROR: cannot push down this subquery
DETAIL: d1 and d3_not_colocated are not colocated
DETAIL: <relation> and <relation> are not colocated
-- Basic test cases with ON syntax
-- Test that the join is pushed down to the worker nodes, using "on" syntax
SET client_min_messages TO DEBUG3;
Expand Down
Loading