提交 39856768 编写于 作者: P Pengzhou Tang 提交者: Tang Pengzhou

Fix another issue on of inheritance table

Previously, when creating a APPEND node for inheritance table, if
subpaths has different number segments in gp_distribution_policy,
the whole APPEND node might be assigned with a wrong numsegments,
so some segments can not get plans and lost data in the results.
上级 4b404797
......@@ -1531,8 +1531,16 @@ set_append_path_locus(PlannerInfo *root, Path *pathnode, RelOptInfo *rel,
}
else if (CdbPathLocus_IsPartitioned(pathnode->locus) &&
CdbPathLocus_IsPartitioned(projectedlocus))
{
/*
* subpaths have different distributed policy, mark it as random
* distributed and set the numsegments to the maximum of all
* subpaths to not missing any tuples.
*/
CdbPathLocus_MakeStrewn(&pathnode->locus,
CdbPathLocus_NumSegments(projectedlocus));
Max(CdbPathLocus_NumSegments(pathnode->locus),
CdbPathLocus_NumSegments(projectedlocus)));
}
else
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg_internal("cannot append paths with incompatible distribution")));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册