temp commit for multi task router

pull/896/head
Onder Kalaci 2016-10-20 11:13:52 +03:00
parent 56651c7511
commit 66ab79bc42
2 changed files with 31 additions and 20 deletions

View File

@ -127,18 +127,32 @@ RouterExecutablePlan(MultiPlan *multiPlan, MultiExecutorType executorType)
List *workerDependentTaskList = NIL;
bool masterQueryHasAggregates = false;
/* TODO: this is a hacky solution to allow 0 shard INSERT ... SELECT */
if (masterQuery == NULL)
{
return true;
}
/* router executor cannot execute queries that hit zero shards */
if (taskCount == 0)
if (executorType == MULTI_EXECUTOR_TASK_TRACKER)
{
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 */
workerTask = (Task *) linitial(workerTaskList);
taskType = workerTask->taskType;
@ -148,18 +162,7 @@ RouterExecutablePlan(MultiPlan *multiPlan, MultiExecutorType executorType)
}
/* router executor cannot execute SELECT queries that hit more than one shard */
if (taskCount != 1)
{
return false;
}
if (executorType == MULTI_EXECUTOR_TASK_TRACKER)
{
return false;
}
/* router executor cannot execute repartition jobs */
if (dependedJobCount > 0)
if (taskCount != 1 && taskType == ROUTER_TASK)
{
return false;
}

View File

@ -101,6 +101,14 @@ FROM
WHERE
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
SET client_min_messages TO INFO;
INSERT INTO raw_events_first (user_id, time, value_1, value_2, value_3, value_4) VALUES