mirror of https://github.com/citusdata/citus.git
Make some intermediate results functions public
parent
36ee21c323
commit
66f9f1d6cd
|
@ -76,10 +76,6 @@ typedef struct RemoteFileDestReceiver
|
||||||
} RemoteFileDestReceiver;
|
} RemoteFileDestReceiver;
|
||||||
|
|
||||||
|
|
||||||
static RemoteFileDestReceiver * CreateRemoteFileDestReceiver(char *resultId,
|
|
||||||
EState *executorState,
|
|
||||||
List *initialNodeList,
|
|
||||||
bool writeLocalFile);
|
|
||||||
static void RemoteFileDestReceiverStartup(DestReceiver *dest, int operation,
|
static void RemoteFileDestReceiverStartup(DestReceiver *dest, int operation,
|
||||||
TupleDesc inputTupleDescriptor);
|
TupleDesc inputTupleDescriptor);
|
||||||
static StringInfo ConstructCopyResultStatement(const char *resultId);
|
static StringInfo ConstructCopyResultStatement(const char *resultId);
|
||||||
|
@ -123,8 +119,9 @@ broadcast_intermediate_result(PG_FUNCTION_ARGS)
|
||||||
|
|
||||||
nodeList = ActivePrimaryNodeList();
|
nodeList = ActivePrimaryNodeList();
|
||||||
estate = CreateExecutorState();
|
estate = CreateExecutorState();
|
||||||
resultDest = CreateRemoteFileDestReceiver(resultIdString, estate, nodeList,
|
resultDest = (RemoteFileDestReceiver *) CreateRemoteFileDestReceiver(resultIdString,
|
||||||
writeLocalFile);
|
estate, nodeList,
|
||||||
|
writeLocalFile);
|
||||||
|
|
||||||
ExecuteQueryStringIntoDestReceiver(queryString, paramListInfo,
|
ExecuteQueryStringIntoDestReceiver(queryString, paramListInfo,
|
||||||
(DestReceiver *) resultDest);
|
(DestReceiver *) resultDest);
|
||||||
|
@ -155,8 +152,9 @@ create_intermediate_result(PG_FUNCTION_ARGS)
|
||||||
CheckCitusVersion(ERROR);
|
CheckCitusVersion(ERROR);
|
||||||
|
|
||||||
estate = CreateExecutorState();
|
estate = CreateExecutorState();
|
||||||
resultDest = CreateRemoteFileDestReceiver(resultIdString, estate, nodeList,
|
resultDest = (RemoteFileDestReceiver *) CreateRemoteFileDestReceiver(resultIdString,
|
||||||
writeLocalFile);
|
estate, nodeList,
|
||||||
|
writeLocalFile);
|
||||||
|
|
||||||
ExecuteQueryStringIntoDestReceiver(queryString, paramListInfo,
|
ExecuteQueryStringIntoDestReceiver(queryString, paramListInfo,
|
||||||
(DestReceiver *) resultDest);
|
(DestReceiver *) resultDest);
|
||||||
|
@ -171,7 +169,7 @@ create_intermediate_result(PG_FUNCTION_ARGS)
|
||||||
* CreateRemoteFileDestReceiver creates a DestReceiver that streams results
|
* CreateRemoteFileDestReceiver creates a DestReceiver that streams results
|
||||||
* to a set of worker nodes.
|
* to a set of worker nodes.
|
||||||
*/
|
*/
|
||||||
static RemoteFileDestReceiver *
|
DestReceiver *
|
||||||
CreateRemoteFileDestReceiver(char *resultId, EState *executorState,
|
CreateRemoteFileDestReceiver(char *resultId, EState *executorState,
|
||||||
List *initialNodeList, bool writeLocalFile)
|
List *initialNodeList, bool writeLocalFile)
|
||||||
{
|
{
|
||||||
|
@ -193,7 +191,7 @@ CreateRemoteFileDestReceiver(char *resultId, EState *executorState,
|
||||||
resultDest->memoryContext = CurrentMemoryContext;
|
resultDest->memoryContext = CurrentMemoryContext;
|
||||||
resultDest->writeLocalFile = writeLocalFile;
|
resultDest->writeLocalFile = writeLocalFile;
|
||||||
|
|
||||||
return resultDest;
|
return (DestReceiver *) resultDest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,6 @@ static bool RelationInfoContainsRecurringTuples(PlannerInfo *plannerInfo,
|
||||||
RelOptInfo *relationInfo,
|
RelOptInfo *relationInfo,
|
||||||
RecurringTuplesType *recurType);
|
RecurringTuplesType *recurType);
|
||||||
static bool HasRecurringTuples(Node *node, RecurringTuplesType *recurType);
|
static bool HasRecurringTuples(Node *node, RecurringTuplesType *recurType);
|
||||||
static bool ContainsReadIntermediateResultFunction(Node *node);
|
|
||||||
static bool IsReadIntermediateResultFunction(Node *node);
|
static bool IsReadIntermediateResultFunction(Node *node);
|
||||||
static void ValidateClauseList(List *clauseList);
|
static void ValidateClauseList(List *clauseList);
|
||||||
static bool ExtractFromExpressionWalker(Node *node,
|
static bool ExtractFromExpressionWalker(Node *node,
|
||||||
|
@ -2237,7 +2236,7 @@ HasRecurringTuples(Node *node, RecurringTuplesType *recurType)
|
||||||
* ContainsReadIntermediateResultFunction determines whether an expresion tree contains
|
* ContainsReadIntermediateResultFunction determines whether an expresion tree contains
|
||||||
* a call to the read_intermediate_results function.
|
* a call to the read_intermediate_results function.
|
||||||
*/
|
*/
|
||||||
static bool
|
bool
|
||||||
ContainsReadIntermediateResultFunction(Node *node)
|
ContainsReadIntermediateResultFunction(Node *node)
|
||||||
{
|
{
|
||||||
return FindNodeCheck(node, IsReadIntermediateResultFunction);
|
return FindNodeCheck(node, IsReadIntermediateResultFunction);
|
||||||
|
|
|
@ -16,12 +16,14 @@
|
||||||
|
|
||||||
#include "distributed/multi_copy.h"
|
#include "distributed/multi_copy.h"
|
||||||
#include "nodes/execnodes.h"
|
#include "nodes/execnodes.h"
|
||||||
#include "nodes/execnodes.h"
|
|
||||||
#include "nodes/pg_list.h"
|
#include "nodes/pg_list.h"
|
||||||
#include "tcop/dest.h"
|
#include "tcop/dest.h"
|
||||||
#include "utils/palloc.h"
|
#include "utils/palloc.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern DestReceiver * CreateRemoteFileDestReceiver(char *resultId, EState *executorState,
|
||||||
|
List *initialNodeList, bool
|
||||||
|
writeLocalFile);
|
||||||
extern void ReceiveQueryResultViaCopy(const char *resultId);
|
extern void ReceiveQueryResultViaCopy(const char *resultId);
|
||||||
extern void RemoveIntermediateResultsDirectory(void);
|
extern void RemoveIntermediateResultsDirectory(void);
|
||||||
|
|
||||||
|
|
|
@ -192,6 +192,7 @@ extern PlannerRestrictionContext * FilterPlannerRestrictionForQuery(
|
||||||
Query *query);
|
Query *query);
|
||||||
extern bool SafeToPushdownWindowFunction(Query *query, StringInfo *errorDetail);
|
extern bool SafeToPushdownWindowFunction(Query *query, StringInfo *errorDetail);
|
||||||
extern bool TargetListOnPartitionColumn(Query *query, List *targetEntryList);
|
extern bool TargetListOnPartitionColumn(Query *query, List *targetEntryList);
|
||||||
|
extern bool ContainsReadIntermediateResultFunction(Node *node);
|
||||||
extern MultiNode * ParentNode(MultiNode *multiNode);
|
extern MultiNode * ParentNode(MultiNode *multiNode);
|
||||||
extern MultiNode * ChildNode(MultiUnaryNode *multiNode);
|
extern MultiNode * ChildNode(MultiUnaryNode *multiNode);
|
||||||
extern MultiNode * GrandChildNode(MultiUnaryNode *multiNode);
|
extern MultiNode * GrandChildNode(MultiUnaryNode *multiNode);
|
||||||
|
|
Loading…
Reference in New Issue