* cdbpathlocus_from_exprs * * Returns a locus specifying hashed distribution on a list of exprs. */
| 394 | * Returns a locus specifying hashed distribution on a list of exprs. |
| 395 | */ |
| 396 | CdbPathLocus |
| 397 | cdbpathlocus_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 |
no test coverage detected