* getLikeDistributionPolicy * * For Apache Cloudberry distributed tables, default to * the same distribution as the first LIKE table, unless * we also have INHERITS */
| 5129 | * we also have INHERITS |
| 5130 | */ |
| 5131 | static DistributedBy * |
| 5132 | getLikeDistributionPolicy(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 | /* |
no test coverage detected