Allow numsegments to be specified by DISTRIBUTED BY
CREATE TABLE always set numsegments to DEFAULT, however when there is a DISTRIBUTED BY clause it might already contain a valid numsegments. This will not happen in a user typed CREATE TABLE sql because there is no syntax to specify numsegments, so far the only chance for this to happen is the internal command constructed by reorganization, it might be a CTAS or (CREATE + INSERT), both will pass original numsegments via DISTRIBUTED BY. One bug is that we only accept numsegments passed by CTAS but not the other. The (CREATE + INSERT) command is only constructed in 3 cases: 1. original table contains dropped column(s); 2. original table is AOCO; 3. original table is AO with index(es); Fixed and added tests.
Showing
想要评论请 注册 或 登录