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

Function build_path_tlist

src/backend/optimizer/plan/createplan.c:898–931  ·  view source on GitHub ↗

* Build a target list (ie, a list of TargetEntry) for the Path's output. * * This is almost just make_tlist_from_pathtarget(), but we also have to * deal with replacing nestloop params. */

Source from the content-addressed store, hash-verified

896 * deal with replacing nestloop params.
897 */
898static List *
899build_path_tlist(PlannerInfo *root, Path *path)
900{
901 List *tlist = NIL;
902 Index *sortgrouprefs = path->pathtarget->sortgrouprefs;
903 int resno = 1;
904 ListCell *v;
905
906 foreach(v, path->pathtarget->exprs)
907 {
908 Node *node = (Node *) lfirst(v);
909 TargetEntry *tle;
910
911 /*
912 * If it's a parameterized path, there might be lateral references in
913 * the tlist, which need to be replaced with Params. There's no need
914 * to remake the TargetEntry nodes, so apply this to each list item
915 * separately.
916 */
917 if (path->param_info)
918 node = replace_nestloop_params(root, node);
919
920 tle = makeTargetEntry((Expr *) node,
921 resno,
922 NULL,
923 false);
924 if (sortgrouprefs)
925 tle->ressortgroupref = sortgrouprefs[resno - 1];
926
927 tlist = lappend(tlist, tle);
928 resno++;
929 }
930 return tlist;
931}
932
933/*
934 * use_physical_tlist

Callers 15

create_scan_planFunction · 0.85
create_gating_planFunction · 0.85
create_append_planFunction · 0.85
create_merge_append_planFunction · 0.85
create_group_result_planFunction · 0.85
create_project_set_planFunction · 0.85
create_unique_planFunction · 0.85
create_gather_planFunction · 0.85
create_gather_merge_planFunction · 0.85
create_projection_planFunction · 0.85
create_group_planFunction · 0.85
create_agg_planFunction · 0.85

Calls 4

replace_nestloop_paramsFunction · 0.85
makeTargetEntryFunction · 0.85
lappendFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected