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

Function PrepareSortSupportFromOrderingOp

src/backend/utils/sort/sortsupport.c:134–151  ·  view source on GitHub ↗

* Fill in SortSupport given an ordering operator (btree "<" or ">" operator). * * Caller must previously have zeroed the SortSupportData structure and then * filled in ssup_cxt, ssup_collation, and ssup_nulls_first. This will fill * in ssup_reverse as well as the comparator function pointer. */

Source from the content-addressed store, hash-verified

132 * in ssup_reverse as well as the comparator function pointer.
133 */
134void
135PrepareSortSupportFromOrderingOp(Oid orderingOp, SortSupport ssup)
136{
137 Oid opfamily;
138 Oid opcintype;
139 int16 strategy;
140
141 Assert(ssup->comparator == NULL);
142
143 /* Find the operator in pg_amop */
144 if (!get_ordering_op_properties(orderingOp, &opfamily, &opcintype,
145 &strategy))
146 elog(ERROR, "operator %u is not a valid ordering operator",
147 orderingOp);
148 ssup->ssup_reverse = (strategy == BTGreaterStrategyNumber);
149
150 FinishSortSupportFunction(opfamily, opcintype, ssup);
151}
152
153/*
154 * Fill in SortSupport given an index relation, attribute, and strategy.

Callers 10

statext_mcv_serializeFunction · 0.85
multi_sort_add_dimensionFunction · 0.85
tuplesort_begin_heapFunction · 0.85
tuplesort_begin_datumFunction · 0.85
compute_scalar_statsFunction · 0.85
ExecInitMotionFunction · 0.85
initialize_peraggFunction · 0.85
ExecInitMergeAppendFunction · 0.85
ExecInitGatherMergeFunction · 0.85

Calls 2

Tested by

no test coverage detected