mirror of https://github.com/citusdata/citus.git
133 lines
4.8 KiB
Plaintext
133 lines
4.8 KiB
Plaintext
--
|
|
-- MULTI_REPARTITION_JOIN_TASK_ASSIGNMENT
|
|
--
|
|
-- Tests which cover task assignment for MapMerge jobs for single range repartition
|
|
-- and dual hash repartition joins. The tests also cover task assignment propagation
|
|
-- from a sql task to its depended tasks. Note that we set the executor type to task
|
|
-- tracker executor here, as we cannot run repartition jobs with real time executor.
|
|
SET citus.next_shard_id TO 710000;
|
|
-- print whether we're using version > 9 to make version-specific tests clear
|
|
SHOW server_version \gset
|
|
SELECT substring(:'server_version', '\d+')::int > 9 AS version_above_nine;
|
|
version_above_nine
|
|
--------------------
|
|
t
|
|
(1 row)
|
|
|
|
BEGIN;
|
|
SET client_min_messages TO DEBUG3;
|
|
SET citus.task_executor_type TO 'task-tracker';
|
|
-- Single range repartition join to test anchor-shard based task assignment and
|
|
-- assignment propagation to merge and data-fetch tasks.
|
|
SELECT
|
|
count(*)
|
|
FROM
|
|
orders, customer_append
|
|
WHERE
|
|
o_custkey = c_custkey;
|
|
DEBUG: Unsupported partition method.
|
|
DEBUG: assigned task 2 to node localhost:57637
|
|
DEBUG: assigned task 1 to node localhost:57638
|
|
DEBUG: join prunable for intervals [1,1000] and [1001,2000]
|
|
DEBUG: join prunable for intervals [1,1000] and [6001,7000]
|
|
DEBUG: join prunable for intervals [1001,2000] and [1,1000]
|
|
DEBUG: join prunable for intervals [1001,2000] and [6001,7000]
|
|
DEBUG: join prunable for intervals [6001,7000] and [1,1000]
|
|
DEBUG: join prunable for intervals [6001,7000] and [1001,2000]
|
|
DEBUG: pruning merge fetch taskId 1
|
|
DETAIL: Creating dependency on merge taskId 3
|
|
DEBUG: pruning merge fetch taskId 3
|
|
DETAIL: Creating dependency on merge taskId 6
|
|
DEBUG: pruning merge fetch taskId 5
|
|
DETAIL: Creating dependency on merge taskId 9
|
|
DEBUG: assigned task 4 to node localhost:57637
|
|
DEBUG: assigned task 6 to node localhost:57638
|
|
DEBUG: assigned task 2 to node localhost:57637
|
|
count
|
|
-------
|
|
2985
|
|
(1 row)
|
|
|
|
-- Single range repartition join, along with a join with a small table containing
|
|
-- more than one shard. This situation results in multiple sql tasks depending on
|
|
-- the same merge task, and tests our constraint group creation and assignment
|
|
-- propagation.
|
|
SELECT
|
|
count(*)
|
|
FROM
|
|
orders_reference, customer_append, lineitem
|
|
WHERE
|
|
o_custkey = c_custkey AND
|
|
o_orderkey = l_orderkey;
|
|
DEBUG: Unsupported partition method.
|
|
DEBUG: assigned task 2 to node localhost:57637
|
|
DEBUG: assigned task 3 to node localhost:57638
|
|
DEBUG: assigned task 1 to node localhost:57637
|
|
DEBUG: join prunable for intervals [1,5986] and [8997,14947]
|
|
DEBUG: join prunable for intervals [8997,14947] and [1,5986]
|
|
DEBUG: pruning merge fetch taskId 1
|
|
DETAIL: Creating dependency on merge taskId 4
|
|
DEBUG: pruning merge fetch taskId 3
|
|
DETAIL: Creating dependency on merge taskId 8
|
|
DEBUG: assigned task 4 to node localhost:57637
|
|
DEBUG: assigned task 2 to node localhost:57638
|
|
count
|
|
-------
|
|
12000
|
|
(1 row)
|
|
|
|
-- Dual hash repartition join which tests the separate hash repartition join
|
|
-- task assignment algorithm.
|
|
SELECT
|
|
count(*)
|
|
FROM
|
|
lineitem, customer_append
|
|
WHERE
|
|
l_partkey = c_nationkey;
|
|
DEBUG: Unsupported partition method.
|
|
DEBUG: assigned task 2 to node localhost:57637
|
|
DEBUG: assigned task 1 to node localhost:57638
|
|
DEBUG: assigned task 2 to node localhost:57637
|
|
DEBUG: assigned task 3 to node localhost:57638
|
|
DEBUG: assigned task 1 to node localhost:57637
|
|
DEBUG: join prunable for task partitionId 0 and 1
|
|
DEBUG: join prunable for task partitionId 0 and 2
|
|
DEBUG: join prunable for task partitionId 0 and 3
|
|
DEBUG: join prunable for task partitionId 1 and 0
|
|
DEBUG: join prunable for task partitionId 1 and 2
|
|
DEBUG: join prunable for task partitionId 1 and 3
|
|
DEBUG: join prunable for task partitionId 2 and 0
|
|
DEBUG: join prunable for task partitionId 2 and 1
|
|
DEBUG: join prunable for task partitionId 2 and 3
|
|
DEBUG: join prunable for task partitionId 3 and 0
|
|
DEBUG: join prunable for task partitionId 3 and 1
|
|
DEBUG: join prunable for task partitionId 3 and 2
|
|
DEBUG: pruning merge fetch taskId 1
|
|
DETAIL: Creating dependency on merge taskId 3
|
|
DEBUG: pruning merge fetch taskId 2
|
|
DETAIL: Creating dependency on merge taskId 4
|
|
DEBUG: pruning merge fetch taskId 4
|
|
DETAIL: Creating dependency on merge taskId 6
|
|
DEBUG: pruning merge fetch taskId 5
|
|
DETAIL: Creating dependency on merge taskId 8
|
|
DEBUG: pruning merge fetch taskId 7
|
|
DETAIL: Creating dependency on merge taskId 9
|
|
DEBUG: pruning merge fetch taskId 8
|
|
DETAIL: Creating dependency on merge taskId 12
|
|
DEBUG: pruning merge fetch taskId 10
|
|
DETAIL: Creating dependency on merge taskId 12
|
|
DEBUG: pruning merge fetch taskId 11
|
|
DETAIL: Creating dependency on merge taskId 16
|
|
DEBUG: assigned task 3 to node localhost:57638
|
|
DEBUG: assigned task 6 to node localhost:57637
|
|
DEBUG: assigned task 9 to node localhost:57638
|
|
DEBUG: assigned task 12 to node localhost:57637
|
|
count
|
|
-------
|
|
125
|
|
(1 row)
|
|
|
|
-- Reset client logging level to its previous value
|
|
SET client_min_messages TO NOTICE;
|
|
COMMIT;
|