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

Function consts_to_datums

src/backend/parser/parse_partition_gp.c:296–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296static Datum *
297consts_to_datums(PartitionKey partkey, List *consts)
298{
299 Datum *datums;
300 ListCell *lc;
301 int i;
302
303 if (partkey->partnatts != list_length(consts))
304 elog(ERROR, "wrong number of partition bounds");
305
306 datums = palloc(partkey->partnatts * sizeof(Datum));
307
308 i = 0;
309 foreach(lc, consts)
310 {
311 Const *c = (Const *) lfirst(lc);
312
313 if (!IsA(c, Const))
314 elog(ERROR, "expected Const in partition bound");
315
316 datums[i] = c->constvalue;
317 i++;
318 }
319
320 return datums;
321}
322
323/*
324 * Sort the list of GpPartitionBoundSpecs based first on START, if START does

Callers 1

Calls 3

list_lengthFunction · 0.85
pallocFunction · 0.50
foreachFunction · 0.50

Tested by

no test coverage detected