MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecInitTableFuncScan

Function ExecInitTableFuncScan

src/backend/executor/nodeTableFuncscan.c:109–205  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecInitTableFuncscan * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

107 * ----------------------------------------------------------------
108 */
109TableFuncScanState *
110ExecInitTableFuncScan(TableFuncScan *node, EState *estate, int eflags)
111{
112 TableFuncScanState *scanstate;
113 TableFunc *tf = node->tablefunc;
114 TupleDesc tupdesc;
115 int i;
116
117 /* check for unsupported flags */
118 Assert(!(eflags & EXEC_FLAG_MARK));
119
120 /*
121 * TableFuncscan should not have any children.
122 */
123 Assert(outerPlan(node) == NULL);
124 Assert(innerPlan(node) == NULL);
125
126 /*
127 * create new ScanState for node
128 */
129 scanstate = makeNode(TableFuncScanState);
130 scanstate->ss.ps.plan = (Plan *) node;
131 scanstate->ss.ps.state = estate;
132 scanstate->ss.ps.ExecProcNode = ExecTableFuncScan;
133
134 /*
135 * Miscellaneous initialization
136 *
137 * create expression context for node
138 */
139 ExecAssignExprContext(estate, &scanstate->ss.ps);
140
141 /*
142 * initialize source tuple type
143 */
144 tupdesc = BuildDescFromLists(tf->colnames,
145 tf->coltypes,
146 tf->coltypmods,
147 tf->colcollations);
148 /* and the corresponding scan slot */
149 ExecInitScanTupleSlot(estate, &scanstate->ss, tupdesc,
150 &TTSOpsMinimalTuple);
151
152 /*
153 * Initialize result type and projection.
154 */
155 ExecInitResultTypeTL(&scanstate->ss.ps);
156 ExecAssignScanProjectionInfo(&scanstate->ss);
157
158 /*
159 * initialize child expressions
160 */
161 scanstate->ss.ps.qual =
162 ExecInitQual(node->scan.plan.qual, &scanstate->ss.ps);
163
164 /* Only XMLTABLE is supported currently */
165 scanstate->routine = &XmlTableRoutine;
166

Callers 1

ExecInitNodeFunction · 0.85

Calls 11

ExecAssignExprContextFunction · 0.85
BuildDescFromListsFunction · 0.85
ExecInitScanTupleSlotFunction · 0.85
ExecInitResultTypeTLFunction · 0.85
ExecInitQualFunction · 0.85
ExecInitExprListFunction · 0.85
ExecInitExprFunction · 0.85
getTypeInputInfoFunction · 0.85
fmgr_infoFunction · 0.85
pallocFunction · 0.50

Tested by

no test coverage detected