mirror of https://github.com/citusdata/citus.git
Rename CoordinatorInsertSelect... to NonPushableInsertSelect
parent
cd25a27174
commit
d34c21890f
|
@ -49,7 +49,7 @@
|
|||
/* functions for creating custom scan nodes */
|
||||
static Node * AdaptiveExecutorCreateScan(CustomScan *scan);
|
||||
static Node * TaskTrackerCreateScan(CustomScan *scan);
|
||||
static Node * CoordinatorInsertSelectCreateScan(CustomScan *scan);
|
||||
static Node * NonPushableInsertSelectCreateScan(CustomScan *scan);
|
||||
static Node * DelayedErrorCreateScan(CustomScan *scan);
|
||||
|
||||
/* functions that are common to different scans */
|
||||
|
@ -77,9 +77,9 @@ CustomScanMethods TaskTrackerCustomScanMethods = {
|
|||
TaskTrackerCreateScan
|
||||
};
|
||||
|
||||
CustomScanMethods CoordinatorInsertSelectCustomScanMethods = {
|
||||
CustomScanMethods NonPushableInsertSelectCustomScanMethods = {
|
||||
"Citus INSERT ... SELECT",
|
||||
CoordinatorInsertSelectCreateScan
|
||||
NonPushableInsertSelectCreateScan
|
||||
};
|
||||
|
||||
CustomScanMethods DelayedErrorCustomScanMethods = {
|
||||
|
@ -109,13 +109,13 @@ static CustomExecMethods TaskTrackerCustomExecMethods = {
|
|||
.ExplainCustomScan = CitusExplainScan
|
||||
};
|
||||
|
||||
static CustomExecMethods CoordinatorInsertSelectCustomExecMethods = {
|
||||
.CustomName = "CoordinatorInsertSelectScan",
|
||||
static CustomExecMethods NonPushableInsertSelectCustomExecMethods = {
|
||||
.CustomName = "NonPushableInsertSelectScan",
|
||||
.BeginCustomScan = CitusBeginScan,
|
||||
.ExecCustomScan = CoordinatorInsertSelectExecScan,
|
||||
.ExecCustomScan = NonPushableInsertSelectExecScan,
|
||||
.EndCustomScan = CitusEndScan,
|
||||
.ReScanCustomScan = CitusReScan,
|
||||
.ExplainCustomScan = CoordinatorInsertSelectExplainScan
|
||||
.ExplainCustomScan = NonPushableInsertSelectExplainScan
|
||||
};
|
||||
|
||||
|
||||
|
@ -133,7 +133,7 @@ IsCitusCustomState(PlanState *planState)
|
|||
CustomScanState *css = castNode(CustomScanState, planState);
|
||||
if (css->methods == &AdaptiveExecutorCustomExecMethods ||
|
||||
css->methods == &TaskTrackerCustomExecMethods ||
|
||||
css->methods == &CoordinatorInsertSelectCustomExecMethods)
|
||||
css->methods == &NonPushableInsertSelectCustomExecMethods)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ RegisterCitusCustomScanMethods(void)
|
|||
{
|
||||
RegisterCustomScanMethods(&AdaptiveExecutorCustomScanMethods);
|
||||
RegisterCustomScanMethods(&TaskTrackerCustomScanMethods);
|
||||
RegisterCustomScanMethods(&CoordinatorInsertSelectCustomScanMethods);
|
||||
RegisterCustomScanMethods(&NonPushableInsertSelectCustomScanMethods);
|
||||
RegisterCustomScanMethods(&DelayedErrorCustomScanMethods);
|
||||
}
|
||||
|
||||
|
@ -598,20 +598,20 @@ TaskTrackerCreateScan(CustomScan *scan)
|
|||
|
||||
|
||||
/*
|
||||
* CoordinatorInsertSelectCrateScan creates the scan state for executing
|
||||
* NonPushableInsertSelectCrateScan creates the scan state for executing
|
||||
* INSERT..SELECT into a distributed table via the coordinator.
|
||||
*/
|
||||
static Node *
|
||||
CoordinatorInsertSelectCreateScan(CustomScan *scan)
|
||||
NonPushableInsertSelectCreateScan(CustomScan *scan)
|
||||
{
|
||||
CitusScanState *scanState = palloc0(sizeof(CitusScanState));
|
||||
|
||||
scanState->executorType = MULTI_EXECUTOR_COORDINATOR_INSERT_SELECT;
|
||||
scanState->executorType = MULTI_EXECUTOR_NON_PUSHABLE_INSERT_SELECT;
|
||||
scanState->customScanState.ss.ps.type = T_CustomScanState;
|
||||
scanState->distributedPlan = GetDistributedPlan(scan);
|
||||
|
||||
scanState->customScanState.methods =
|
||||
&CoordinatorInsertSelectCustomExecMethods;
|
||||
&NonPushableInsertSelectCustomExecMethods;
|
||||
|
||||
return (Node *) scanState;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ bool EnableRepartitionedInsertSelect = true;
|
|||
static int insertSelectExecutorLevel = 0;
|
||||
|
||||
|
||||
static TupleTableSlot * CoordinatorInsertSelectExecScanInternal(CustomScanState *node);
|
||||
static TupleTableSlot * NonPushableInsertSelectExecScanInternal(CustomScanState *node);
|
||||
static Query * WrapSubquery(Query *subquery);
|
||||
static List * TwoPhaseInsertSelectTaskList(Oid targetRelationId, Query *insertSelectQuery,
|
||||
char *resultIdPrefix);
|
||||
|
@ -85,19 +85,19 @@ static void RelableTargetEntryList(List *selectTargetList, List *insertTargetLis
|
|||
|
||||
|
||||
/*
|
||||
* CoordinatorInsertSelectExecScan is a wrapper around
|
||||
* CoordinatorInsertSelectExecScanInternal which also properly increments
|
||||
* NonPushableInsertSelectExecScan is a wrapper around
|
||||
* NonPushableInsertSelectExecScanInternal which also properly increments
|
||||
* or decrements insertSelectExecutorLevel.
|
||||
*/
|
||||
TupleTableSlot *
|
||||
CoordinatorInsertSelectExecScan(CustomScanState *node)
|
||||
NonPushableInsertSelectExecScan(CustomScanState *node)
|
||||
{
|
||||
TupleTableSlot *result = NULL;
|
||||
insertSelectExecutorLevel++;
|
||||
|
||||
PG_TRY();
|
||||
{
|
||||
result = CoordinatorInsertSelectExecScanInternal(node);
|
||||
result = NonPushableInsertSelectExecScanInternal(node);
|
||||
}
|
||||
PG_CATCH();
|
||||
{
|
||||
|
@ -112,13 +112,12 @@ CoordinatorInsertSelectExecScan(CustomScanState *node)
|
|||
|
||||
|
||||
/*
|
||||
* CoordinatorInsertSelectExecScan executes an INSERT INTO distributed_table
|
||||
* SELECT .. query by setting up a DestReceiver that copies tuples into the
|
||||
* distributed table and then executing the SELECT query using that DestReceiver
|
||||
* as the tuple destination.
|
||||
* NonPushableInsertSelectExecScan executes an INSERT INTO distributed_table
|
||||
* SELECT .. query either by routing via coordinator or by repartitioning
|
||||
* task results and moving data directly between nodes.
|
||||
*/
|
||||
static TupleTableSlot *
|
||||
CoordinatorInsertSelectExecScanInternal(CustomScanState *node)
|
||||
NonPushableInsertSelectExecScanInternal(CustomScanState *node)
|
||||
{
|
||||
CitusScanState *scanState = (CitusScanState *) node;
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ JobExecutorType(DistributedPlan *distributedPlan)
|
|||
* the executor already knows how to handle adaptive
|
||||
* executor when necessary.
|
||||
*/
|
||||
return MULTI_EXECUTOR_COORDINATOR_INSERT_SELECT;
|
||||
return MULTI_EXECUTOR_NON_PUSHABLE_INSERT_SELECT;
|
||||
}
|
||||
|
||||
Assert(distributedPlan->modLevel == ROW_MODIFY_READONLY);
|
||||
|
|
|
@ -99,7 +99,7 @@ CitusExecutorName(MultiExecutorType executorType)
|
|||
return "task-tracker";
|
||||
}
|
||||
|
||||
case MULTI_EXECUTOR_COORDINATOR_INSERT_SELECT:
|
||||
case MULTI_EXECUTOR_NON_PUSHABLE_INSERT_SELECT:
|
||||
{
|
||||
return "insert-select";
|
||||
}
|
||||
|
|
|
@ -1295,9 +1295,9 @@ FinalizePlan(PlannedStmt *localPlan, DistributedPlan *distributedPlan)
|
|||
break;
|
||||
}
|
||||
|
||||
case MULTI_EXECUTOR_COORDINATOR_INSERT_SELECT:
|
||||
case MULTI_EXECUTOR_NON_PUSHABLE_INSERT_SELECT:
|
||||
{
|
||||
customScan->methods = &CoordinatorInsertSelectCustomScanMethods;
|
||||
customScan->methods = &NonPushableInsertSelectCustomScanMethods;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -198,12 +198,13 @@ CitusExplainScan(CustomScanState *node, List *ancestors, struct ExplainState *es
|
|||
|
||||
|
||||
/*
|
||||
* CoordinatorInsertSelectExplainScan is a custom scan explain callback function
|
||||
* NonPushableInsertSelectExplainScan is a custom scan explain callback function
|
||||
* which is used to print explain information of a Citus plan for an INSERT INTO
|
||||
* distributed_table SELECT ... query that is evaluated on the coordinator.
|
||||
* distributed_table SELECT ... query that is evaluated on the coordinator or
|
||||
* uses repartitioning.
|
||||
*/
|
||||
void
|
||||
CoordinatorInsertSelectExplainScan(CustomScanState *node, List *ancestors,
|
||||
NonPushableInsertSelectExplainScan(CustomScanState *node, List *ancestors,
|
||||
struct ExplainState *es)
|
||||
{
|
||||
CitusScanState *scanState = (CitusScanState *) node;
|
||||
|
|
|
@ -32,7 +32,7 @@ typedef struct CitusScanState
|
|||
/* custom scan methods for all executors */
|
||||
extern CustomScanMethods AdaptiveExecutorCustomScanMethods;
|
||||
extern CustomScanMethods TaskTrackerCustomScanMethods;
|
||||
extern CustomScanMethods CoordinatorInsertSelectCustomScanMethods;
|
||||
extern CustomScanMethods NonPushableInsertSelectCustomScanMethods;
|
||||
extern CustomScanMethods DelayedErrorCustomScanMethods;
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
extern bool EnableRepartitionedInsertSelect;
|
||||
|
||||
extern TupleTableSlot * CoordinatorInsertSelectExecScan(CustomScanState *node);
|
||||
extern TupleTableSlot * NonPushableInsertSelectExecScan(CustomScanState *node);
|
||||
extern bool ExecutingInsertSelect(void);
|
||||
extern Query * BuildSelectForInsertSelect(Query *insertSelectQuery);
|
||||
extern bool IsSupportedRedistributionTarget(Oid targetRelationId);
|
||||
|
|
|
@ -29,7 +29,7 @@ extern bool InsertSelectIntoLocalTable(Query *query);
|
|||
extern Query * ReorderInsertSelectTargetLists(Query *originalQuery,
|
||||
RangeTblEntry *insertRte,
|
||||
RangeTblEntry *subqueryRte);
|
||||
extern void CoordinatorInsertSelectExplainScan(CustomScanState *node, List *ancestors,
|
||||
extern void NonPushableInsertSelectExplainScan(CustomScanState *node, List *ancestors,
|
||||
struct ExplainState *es);
|
||||
extern DistributedPlan * CreateInsertSelectPlan(uint64 planId, Query *originalQuery,
|
||||
PlannerRestrictionContext *
|
||||
|
|
|
@ -88,7 +88,7 @@ typedef enum
|
|||
MULTI_EXECUTOR_INVALID_FIRST = 0,
|
||||
MULTI_EXECUTOR_ADAPTIVE = 1,
|
||||
MULTI_EXECUTOR_TASK_TRACKER = 2,
|
||||
MULTI_EXECUTOR_COORDINATOR_INSERT_SELECT = 3
|
||||
MULTI_EXECUTOR_NON_PUSHABLE_INSERT_SELECT = 3
|
||||
} MultiExecutorType;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue