mirror of https://github.com/citusdata/citus.git
temp commit for multi task router
parent
56651c7511
commit
66ab79bc42
|
@ -127,18 +127,32 @@ RouterExecutablePlan(MultiPlan *multiPlan, MultiExecutorType executorType)
|
||||||
List *workerDependentTaskList = NIL;
|
List *workerDependentTaskList = NIL;
|
||||||
bool masterQueryHasAggregates = false;
|
bool masterQueryHasAggregates = false;
|
||||||
|
|
||||||
/* TODO: this is a hacky solution to allow 0 shard INSERT ... SELECT */
|
if (executorType == MULTI_EXECUTOR_TASK_TRACKER)
|
||||||
if (masterQuery == NULL)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* router executor cannot execute queries that hit zero shards */
|
|
||||||
if (taskCount == 0)
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* router executor cannot execute repartition jobs */
|
||||||
|
if (dependedJobCount > 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* router executor cannot execute plans when master query is present */
|
||||||
|
if (masterQuery != NULL)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Multi task router executor can execute plans with zero task. This is currently
|
||||||
|
* here for INSERT ... SELECT queries with zero shards.
|
||||||
|
*/
|
||||||
|
if (taskCount == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/* check if the first task is a modify or a router task, short-circuit if so */
|
/* check if the first task is a modify or a router task, short-circuit if so */
|
||||||
workerTask = (Task *) linitial(workerTaskList);
|
workerTask = (Task *) linitial(workerTaskList);
|
||||||
taskType = workerTask->taskType;
|
taskType = workerTask->taskType;
|
||||||
|
@ -148,18 +162,7 @@ RouterExecutablePlan(MultiPlan *multiPlan, MultiExecutorType executorType)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* router executor cannot execute SELECT queries that hit more than one shard */
|
/* router executor cannot execute SELECT queries that hit more than one shard */
|
||||||
if (taskCount != 1)
|
if (taskCount != 1 && taskType == ROUTER_TASK)
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (executorType == MULTI_EXECUTOR_TASK_TRACKER)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* router executor cannot execute repartition jobs */
|
|
||||||
if (dependedJobCount > 0)
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,14 @@ FROM
|
||||||
WHERE
|
WHERE
|
||||||
0 != 0;
|
0 != 0;
|
||||||
|
|
||||||
|
INSERT INTO raw_events_second (value_2, value_1, value_3, value_4, user_id, time)
|
||||||
|
SELECT
|
||||||
|
value_2, value_1, value_3, value_4, user_id, time
|
||||||
|
FROM
|
||||||
|
raw_events_first
|
||||||
|
WHERE
|
||||||
|
user_id = 15 AND user_id = 16;
|
||||||
|
|
||||||
-- add one more row
|
-- add one more row
|
||||||
SET client_min_messages TO INFO;
|
SET client_min_messages TO INFO;
|
||||||
INSERT INTO raw_events_first (user_id, time, value_1, value_2, value_3, value_4) VALUES
|
INSERT INTO raw_events_first (user_id, time, value_1, value_2, value_3, value_4) VALUES
|
||||||
|
|
Loading…
Reference in New Issue