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

Function getLikeDistributionPolicy

src/backend/parser/parse_utilcmd.c:5131–5147  ·  view source on GitHub ↗

* getLikeDistributionPolicy * * For Apache Cloudberry distributed tables, default to * the same distribution as the first LIKE table, unless * we also have INHERITS */

Source from the content-addressed store, hash-verified

5129 * we also have INHERITS
5130 */
5131static DistributedBy *
5132getLikeDistributionPolicy(TableLikeClause *e)
5133{
5134 DistributedBy *likeDistributedBy = NULL;
5135 Relation rel;
5136
5137 rel = relation_openrv(e->relation, AccessShareLock);
5138
5139 if (rel->rd_cdbpolicy != NULL && rel->rd_cdbpolicy->ptype != POLICYTYPE_ENTRY)
5140 {
5141 likeDistributedBy = make_distributedby_for_rel(rel);
5142 }
5143
5144 relation_close(rel, AccessShareLock);
5145
5146 return likeDistributedBy;
5147}
5148
5149
5150/*

Callers 2

transformCreateStmtFunction · 0.85

Calls 3

relation_openrvFunction · 0.85
relation_closeFunction · 0.85

Tested by

no test coverage detected