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

Function ExecInitResultRelation

src/backend/executor/execUtils.c:891–915  ·  view source on GitHub ↗

* ExecInitResultRelation * Open relation given by the passed-in RT index and fill its * ResultRelInfo node * * Here, we also save the ResultRelInfo in estate->es_result_relations array * such that it can be accessed later using the RT index. */

Source from the content-addressed store, hash-verified

889 * such that it can be accessed later using the RT index.
890 */
891void
892ExecInitResultRelation(EState *estate, ResultRelInfo *resultRelInfo,
893 Index rti)
894{
895 Relation resultRelationDesc;
896
897 resultRelationDesc = ExecGetRangeTableRelation(estate, rti);
898 InitResultRelInfo(resultRelInfo,
899 resultRelationDesc,
900 rti,
901 NULL,
902 estate->es_instrument);
903
904 if (estate->es_result_relations == NULL)
905 estate->es_result_relations = (ResultRelInfo **)
906 palloc0(estate->es_range_table_size * sizeof(ResultRelInfo *));
907 estate->es_result_relations[rti - 1] = resultRelInfo;
908
909 /*
910 * Saving in the list allows to avoid needlessly traversing the whole
911 * array when only a few of its entries are possibly non-NULL.
912 */
913 estate->es_opened_result_relations =
914 lappend(estate->es_opened_result_relations, resultRelInfo);
915}
916
917/*
918 * UpdateChangedParamSet

Callers 3

CopyFromDirectoryTableFunction · 0.85
CopyFromFunction · 0.85
ExecInitModifyTableFunction · 0.85

Calls 4

InitResultRelInfoFunction · 0.85
lappendFunction · 0.85
palloc0Function · 0.50

Tested by

no test coverage detected