diff --git a/src/backend/distributed/executor/intermediate_results.c b/src/backend/distributed/executor/intermediate_results.c index 54acd5918..8c9e17b43 100644 --- a/src/backend/distributed/executor/intermediate_results.c +++ b/src/backend/distributed/executor/intermediate_results.c @@ -76,10 +76,6 @@ typedef struct RemoteFileDestReceiver } RemoteFileDestReceiver; -static RemoteFileDestReceiver * CreateRemoteFileDestReceiver(char *resultId, - EState *executorState, - List *initialNodeList, - bool writeLocalFile); static void RemoteFileDestReceiverStartup(DestReceiver *dest, int operation, TupleDesc inputTupleDescriptor); static StringInfo ConstructCopyResultStatement(const char *resultId); @@ -123,8 +119,9 @@ broadcast_intermediate_result(PG_FUNCTION_ARGS) nodeList = ActivePrimaryNodeList(); estate = CreateExecutorState(); - resultDest = CreateRemoteFileDestReceiver(resultIdString, estate, nodeList, - writeLocalFile); + resultDest = (RemoteFileDestReceiver *) CreateRemoteFileDestReceiver(resultIdString, + estate, nodeList, + writeLocalFile); ExecuteQueryStringIntoDestReceiver(queryString, paramListInfo, (DestReceiver *) resultDest); @@ -155,8 +152,9 @@ create_intermediate_result(PG_FUNCTION_ARGS) CheckCitusVersion(ERROR); estate = CreateExecutorState(); - resultDest = CreateRemoteFileDestReceiver(resultIdString, estate, nodeList, - writeLocalFile); + resultDest = (RemoteFileDestReceiver *) CreateRemoteFileDestReceiver(resultIdString, + estate, nodeList, + writeLocalFile); ExecuteQueryStringIntoDestReceiver(queryString, paramListInfo, (DestReceiver *) resultDest); @@ -171,7 +169,7 @@ create_intermediate_result(PG_FUNCTION_ARGS) * CreateRemoteFileDestReceiver creates a DestReceiver that streams results * to a set of worker nodes. */ -static RemoteFileDestReceiver * +DestReceiver * CreateRemoteFileDestReceiver(char *resultId, EState *executorState, List *initialNodeList, bool writeLocalFile) { @@ -193,7 +191,7 @@ CreateRemoteFileDestReceiver(char *resultId, EState *executorState, resultDest->memoryContext = CurrentMemoryContext; resultDest->writeLocalFile = writeLocalFile; - return resultDest; + return (DestReceiver *) resultDest; } diff --git a/src/backend/distributed/planner/multi_logical_planner.c b/src/backend/distributed/planner/multi_logical_planner.c index 853c03930..f149d1e53 100644 --- a/src/backend/distributed/planner/multi_logical_planner.c +++ b/src/backend/distributed/planner/multi_logical_planner.c @@ -131,7 +131,6 @@ static bool RelationInfoContainsRecurringTuples(PlannerInfo *plannerInfo, RelOptInfo *relationInfo, RecurringTuplesType *recurType); static bool HasRecurringTuples(Node *node, RecurringTuplesType *recurType); -static bool ContainsReadIntermediateResultFunction(Node *node); static bool IsReadIntermediateResultFunction(Node *node); static void ValidateClauseList(List *clauseList); static bool ExtractFromExpressionWalker(Node *node, @@ -2237,7 +2236,7 @@ HasRecurringTuples(Node *node, RecurringTuplesType *recurType) * ContainsReadIntermediateResultFunction determines whether an expresion tree contains * a call to the read_intermediate_results function. */ -static bool +bool ContainsReadIntermediateResultFunction(Node *node) { return FindNodeCheck(node, IsReadIntermediateResultFunction); diff --git a/src/include/distributed/intermediate_results.h b/src/include/distributed/intermediate_results.h index 139ab5d9b..d5be37c8c 100644 --- a/src/include/distributed/intermediate_results.h +++ b/src/include/distributed/intermediate_results.h @@ -16,12 +16,14 @@ #include "distributed/multi_copy.h" #include "nodes/execnodes.h" -#include "nodes/execnodes.h" #include "nodes/pg_list.h" #include "tcop/dest.h" #include "utils/palloc.h" +extern DestReceiver * CreateRemoteFileDestReceiver(char *resultId, EState *executorState, + List *initialNodeList, bool + writeLocalFile); extern void ReceiveQueryResultViaCopy(const char *resultId); extern void RemoveIntermediateResultsDirectory(void); diff --git a/src/include/distributed/multi_logical_planner.h b/src/include/distributed/multi_logical_planner.h index 68b189d1f..708355e58 100644 --- a/src/include/distributed/multi_logical_planner.h +++ b/src/include/distributed/multi_logical_planner.h @@ -192,6 +192,7 @@ extern PlannerRestrictionContext * FilterPlannerRestrictionForQuery( Query *query); extern bool SafeToPushdownWindowFunction(Query *query, StringInfo *errorDetail); extern bool TargetListOnPartitionColumn(Query *query, List *targetEntryList); +extern bool ContainsReadIntermediateResultFunction(Node *node); extern MultiNode * ParentNode(MultiNode *multiNode); extern MultiNode * ChildNode(MultiUnaryNode *multiNode); extern MultiNode * GrandChildNode(MultiUnaryNode *multiNode);