1 /*-------------------------------------------------------------------------
2  *
3  * citus_nodefuncs.h
4  *	  Node (de-)serialization support for Citus.
5  *
6  * Copyright (c) Citus Data, Inc.
7  *
8  *-------------------------------------------------------------------------
9  */
10 
11 #ifndef CITUS_NODEFUNCS_H
12 #define CITUS_NODEFUNCS_H
13 
14 #include "distributed/multi_physical_planner.h"
15 #include "nodes/nodes.h"
16 #include "nodes/parsenodes.h"
17 
18 /* citus_nodefuncs.c */
19 extern void SetRangeTblExtraData(RangeTblEntry *rte, CitusRTEKind rteKind,
20 								 char *fragmentSchemaName, char *fragmentTableName,
21 								 List *tableIdList, List *funcColumnNames,
22 								 List *funcColumnTypes, List *funcColumnTypeMods,
23 								 List *funcCollations);
24 extern void ModifyRangeTblExtraData(RangeTblEntry *rte, CitusRTEKind rteKind,
25 									char *fragmentSchemaName, char *fragmentTableName,
26 									List *tableIdList);
27 extern void ExtractRangeTblExtraData(RangeTblEntry *rte, CitusRTEKind *rteKind,
28 									 char **fragmentSchemaName, char **fragmentTableName,
29 									 List **tableIdList);
30 extern CitusRTEKind GetRangeTblKind(RangeTblEntry *rte);
31 
32 extern void RegisterNodes(void);
33 
34 #define READFUNC_ARGS struct ExtensibleNode *node
35 #define OUTFUNC_ARGS StringInfo str, const struct ExtensibleNode *raw_node
36 #define COPYFUNC_ARGS struct ExtensibleNode *target_node, const struct \
37 	ExtensibleNode *source_node
38 
39 extern void ReadUnsupportedCitusNode(READFUNC_ARGS);
40 
41 extern void OutJob(OUTFUNC_ARGS);
42 extern void OutDistributedPlan(OUTFUNC_ARGS);
43 extern void OutDistributedSubPlan(OUTFUNC_ARGS);
44 extern void OutUsedDistributedSubPlan(OUTFUNC_ARGS);
45 extern void OutShardInterval(OUTFUNC_ARGS);
46 extern void OutMapMergeJob(OUTFUNC_ARGS);
47 extern void OutShardPlacement(OUTFUNC_ARGS);
48 extern void OutRelationShard(OUTFUNC_ARGS);
49 extern void OutRelationRowLock(OUTFUNC_ARGS);
50 extern void OutTask(OUTFUNC_ARGS);
51 extern void OutLocalPlannedStatement(OUTFUNC_ARGS);
52 extern void OutDeferredErrorMessage(OUTFUNC_ARGS);
53 extern void OutGroupShardPlacement(OUTFUNC_ARGS);
54 
55 extern void OutMultiNode(OUTFUNC_ARGS);
56 extern void OutMultiTreeRoot(OUTFUNC_ARGS);
57 extern void OutMultiProject(OUTFUNC_ARGS);
58 extern void OutMultiCollect(OUTFUNC_ARGS);
59 extern void OutMultiSelect(OUTFUNC_ARGS);
60 extern void OutMultiTable(OUTFUNC_ARGS);
61 extern void OutMultiJoin(OUTFUNC_ARGS);
62 extern void OutMultiPartition(OUTFUNC_ARGS);
63 extern void OutMultiCartesianProduct(OUTFUNC_ARGS);
64 extern void OutMultiExtendedOp(OUTFUNC_ARGS);
65 extern void OutTableDDLCommand(OUTFUNC_ARGS);
66 
67 extern void CopyNodeJob(COPYFUNC_ARGS);
68 extern void CopyNodeDistributedPlan(COPYFUNC_ARGS);
69 extern void CopyNodeDistributedSubPlan(COPYFUNC_ARGS);
70 extern void CopyNodeUsedDistributedSubPlan(COPYFUNC_ARGS);
71 extern void CopyNodeShardInterval(COPYFUNC_ARGS);
72 extern void CopyNodeMapMergeJob(COPYFUNC_ARGS);
73 extern void CopyNodeShardPlacement(COPYFUNC_ARGS);
74 extern void CopyNodeGroupShardPlacement(COPYFUNC_ARGS);
75 extern void CopyNodeRelationShard(COPYFUNC_ARGS);
76 extern void CopyNodeRelationRowLock(COPYFUNC_ARGS);
77 extern void CopyNodeTask(COPYFUNC_ARGS);
78 extern void CopyNodeLocalPlannedStatement(COPYFUNC_ARGS);
79 extern void CopyNodeTaskQuery(COPYFUNC_ARGS);
80 extern void CopyNodeDeferredErrorMessage(COPYFUNC_ARGS);
81 
82 #endif /* CITUS_NODEFUNCS_H */
83