Running citus_indent to resolve indentation issues

pull/7810/head
Muhammad Usama 2024-12-26 00:51:38 +05:00 committed by Muhammad Usama
parent 2943e7f18d
commit 5d148b75c3
1 changed files with 24 additions and 11 deletions

View File

@ -300,7 +300,8 @@ GetConversionChoice(ConversionCandidates *conversionCandidates,
* If Local table is referenced by the InitPlan that is kind of a One time filter, * If Local table is referenced by the InitPlan that is kind of a One time filter,
* In that case we should refrain from converting the local tables. * In that case we should refrain from converting the local tables.
*/ */
return localRTECandidate && (!localRTECandidate->hasDependencyOnInitPlanParam) ? return localRTECandidate &&
(!localRTECandidate->hasDependencyOnInitPlanParam) ?
CONVERT_LOCAL_TABLES : CONVERT_DISTRIBUTED_TABLES; CONVERT_LOCAL_TABLES : CONVERT_DISTRIBUTED_TABLES;
} }
else if (LocalTableJoinPolicy == LOCAL_JOIN_POLICY_PREFER_DISTRIBUTED) else if (LocalTableJoinPolicy == LOCAL_JOIN_POLICY_PREFER_DISTRIBUTED)
@ -325,7 +326,8 @@ GetConversionChoice(ConversionCandidates *conversionCandidates,
} }
else else
{ {
return localRTECandidate && (!localRTECandidate->hasDependencyOnInitPlanParam) ? return localRTECandidate &&
(!localRTECandidate->hasDependencyOnInitPlanParam) ?
CONVERT_LOCAL_TABLES : CONVERT_DISTRIBUTED_TABLES; CONVERT_LOCAL_TABLES : CONVERT_DISTRIBUTED_TABLES;
} }
} }
@ -405,7 +407,6 @@ static bool
HasDependencyOnInitPlanParam(RangeTblEntry *rangeTableEntry, HasDependencyOnInitPlanParam(RangeTblEntry *rangeTableEntry,
RelationRestriction *relationRestriction) RelationRestriction *relationRestriction)
{ {
List* whereClauseList;
List *initPlanParamIDs = NIL; List *initPlanParamIDs = NIL;
ListCell *lc = NULL; ListCell *lc = NULL;
@ -414,11 +415,17 @@ HasDependencyOnInitPlanParam(RangeTblEntry *rangeTableEntry,
* does not contain joininfo. * does not contain joininfo.
*/ */
if (rangeTableEntry == NULL || relationRestriction == NULL) if (rangeTableEntry == NULL || relationRestriction == NULL)
{
return false; return false;
}
if (relationRestriction->relOptInfo->joininfo == NULL) if (relationRestriction->relOptInfo->joininfo == NULL)
{
return false; return false;
}
if (relationRestriction->plannerInfo->init_plans == NULL) if (relationRestriction->plannerInfo->init_plans == NULL)
{
return false; return false;
}
/* /*
* Gather all parameter IDs referenced by the InitPlan * Gather all parameter IDs referenced by the InitPlan
@ -432,19 +439,24 @@ HasDependencyOnInitPlanParam(RangeTblEntry *rangeTableEntry,
SubPlan *subplan = (SubPlan *) plan; SubPlan *subplan = (SubPlan *) plan;
if (subplan->setParam != NIL) if (subplan->setParam != NIL)
{ {
initPlanParamIDs = list_concat_unique_int(initPlanParamIDs, subplan->setParam); initPlanParamIDs = list_concat_unique_int(initPlanParamIDs,
subplan->setParam);
} }
} }
} }
if (initPlanParamIDs == NIL) if (initPlanParamIDs == NIL)
{
return false; return false;
}
/* /*
* Check if any parameter in the join conditions (join info) for this relation * Check if any parameter in the join conditions (join info) for this relation
* is referenced by the initPlan. This is important to ensure that we can * is referenced by the initPlan. This is important to ensure that we can
* decide whether we want to convert local or remote tables. * decide whether we want to convert local or remote tables.
*/ */
whereClauseList = extract_actual_clauses(relationRestriction->relOptInfo->joininfo, true); List *whereClauseList = extract_actual_clauses(
relationRestriction->relOptInfo->joininfo,
true);
foreach(lc, whereClauseList) foreach(lc, whereClauseList)
{ {
@ -465,6 +477,7 @@ HasDependencyOnInitPlanParam(RangeTblEntry *rangeTableEntry,
return false; return false;
} }
/* /*
* HasConstantFilterOnUniqueColumn returns true if the given rangeTableEntry has a constant * HasConstantFilterOnUniqueColumn returns true if the given rangeTableEntry has a constant
* filter on a unique column. * filter on a unique column.