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

Function ExpandIndirectionStar

src/backend/parser/parse_target.c:1343–1359  ·  view source on GitHub ↗

* ExpandIndirectionStar() * Transforms foo.* into a list of expressions or targetlist entries. * * This handles the case where '*' appears as the last item in A_Indirection. * The code is shared between the case of foo.* at the top level in a SELECT * target list (where we want TargetEntry nodes in the result) and foo.* in * a ROW() or VALUES() construct (where we want just bare expressions

Source from the content-addressed store, hash-verified

1341 * this rather than relying on exprKind.
1342 */
1343static List *
1344ExpandIndirectionStar(ParseState *pstate, A_Indirection *ind,
1345 bool make_target_entry, ParseExprKind exprKind)
1346{
1347 Node *expr;
1348
1349 /* Strip off the '*' to create a reference to the rowtype object */
1350 ind = copyObject(ind);
1351 ind->indirection = list_truncate(ind->indirection,
1352 list_length(ind->indirection) - 1);
1353
1354 /* And transform that */
1355 expr = transformExpr(pstate, (Node *) ind, exprKind);
1356
1357 /* Expand the rowtype expression into individual fields */
1358 return ExpandRowReference(pstate, expr, make_target_entry);
1359}
1360
1361/*
1362 * ExpandSingleTable()

Callers 2

transformTargetListFunction · 0.85
transformExpressionListFunction · 0.85

Calls 4

list_truncateFunction · 0.85
list_lengthFunction · 0.85
transformExprFunction · 0.85
ExpandRowReferenceFunction · 0.85

Tested by

no test coverage detected