create_distributed_table with fk to ref table is implemented

pull/2240/head
mehmet furkan şahin 2018-06-19 16:29:36 +03:00
parent 2fa4e38841
commit 45f8017f42
1 changed files with 7 additions and 0 deletions

View File

@ -668,6 +668,13 @@ WorkerCreateShard(Oid relationId, int shardIndex, uint64 shardId, List *ddlComma
{
referencedShardId = shardId;
}
else if (PartitionMethod(referencedRelationId) == DISTRIBUTE_BY_NONE)
{
List *shardList = LoadShardList(referencedRelationId);
uint64 *shardIdPointer = (uint64 *) linitial(shardList);
referencedShardId = (*shardIdPointer);
}
else
{
referencedShardId = ColocatedShardIdInRelation(referencedRelationId,