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

Function cdbpathlocus_from_exprs

src/backend/cdb/cdbpathlocus.c:396–422  ·  view source on GitHub ↗

* cdbpathlocus_from_exprs * * Returns a locus specifying hashed distribution on a list of exprs. */

Source from the content-addressed store, hash-verified

394 * Returns a locus specifying hashed distribution on a list of exprs.
395 */
396CdbPathLocus
397cdbpathlocus_from_exprs(struct PlannerInfo *root,
398 RelOptInfo *rel,
399 List *hash_on_exprs,
400 List *hash_opfamilies,
401 List *hash_sortrefs,
402 int numsegments,
403 int parallel_workers)
404{
405 CdbPathLocus locus;
406 List *distkeys = NIL;
407 ListCell *le, *lof, *lsr;
408
409 forthree(le, hash_on_exprs, lof, hash_opfamilies, lsr, hash_sortrefs)
410 {
411 Node *expr = (Node *) lfirst(le);
412 Oid opfamily = lfirst_oid(lof);
413 int sortref = lfirst_int(lsr);
414 DistributionKey *distkey;
415
416 distkey = cdb_make_distkey_for_expr(root, rel, expr, opfamily, sortref);
417 distkeys = lappend(distkeys, distkey);
418 }
419
420 CdbPathLocus_MakeHashed(&locus, distkeys, numsegments, parallel_workers);
421 return locus;
422} /* cdbpathlocus_from_exprs */
423
424/*
425 * cdbpathlocus_from_subquery

Callers 5

choose_grouping_locusFunction · 0.85
create_scatter_pathFunction · 0.85
create_unique_pathFunction · 0.85
create_unique_rowid_pathFunction · 0.85

Calls 2

lappendFunction · 0.85

Tested by

no test coverage detected