{"action":"opened","number":6363,"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/6363","id":234479707,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0NDc5NzA3","html_url":"https://github.com/greenplum-db/gpdb/pull/6363","diff_url":"https://github.com/greenplum-db/gpdb/pull/6363.diff","patch_url":"https://github.com/greenplum-db/gpdb/pull/6363.patch","issue_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/6363","number":6363,"state":"open","locked":false,"title":"Allow numsegments to be specified by DISTRIBUTED BY.","user":{"login":"pivotal-ning-yu","id":25739550,"node_id":"MDQ6VXNlcjI1NzM5NTUw","avatar_url":"https://avatars2.githubusercontent.com/u/25739550?v=4","gravatar_id":"","url":"https://api.github.com/users/pivotal-ning-yu","html_url":"https://github.com/pivotal-ning-yu","followers_url":"https://api.github.com/users/pivotal-ning-yu/followers","following_url":"https://api.github.com/users/pivotal-ning-yu/following{/other_user}","gists_url":"https://api.github.com/users/pivotal-ning-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotal-ning-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotal-ning-yu/subscriptions","organizations_url":"https://api.github.com/users/pivotal-ning-yu/orgs","repos_url":"https://api.github.com/users/pivotal-ning-yu/repos","events_url":"https://api.github.com/users/pivotal-ning-yu/events{/privacy}","received_events_url":"https://api.github.com/users/pivotal-ning-yu/received_events","type":"User","site_admin":false},"body":"CREATE TABLE always set numsegments to DEFAULT, however when there is a\r\nDISTRIBUTED BY clause it might already contain a valid numsegments.\r\n\r\nThis will not happen in a user typed CREATE TABLE sql because there is\r\nno syntax to specify numsegments, so far the only chance for this to\r\nhappen is the internal command constructed by reorganization, it might\r\nbe a CTAS or (CREATE + INSERT), both will pass original numsegments via\r\nDISTRIBUTED BY.\r\n\r\nOne bug is that we only accept numsegments passed by CTAS but not the\r\nother.  The (CREATE + INSERT) command is only constructed in 3 cases:\r\n\r\n1. original table contains dropped column(s);\r\n2. original table is AOCO;\r\n3. original table is AO with index(es);\r\n\r\nFixed and added tests.\r\n\r\n( This PR contains two commits, the first is exactly the same as https://github.com/greenplum-db/gpdb/pull/6352, please only review the second )","created_at":"2018-11-29T01:29:51Z","updated_at":"2018-11-29T01:29:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/6363/commits","review_comments_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/6363/comments","review_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/6363/comments","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/1e32657d3253a9a4435dd559858883f8980e0b59","head":{"label":"pivotal-ning-yu:ctas_numsegments","ref":"ctas_numsegments","sha":"1e32657d3253a9a4435dd559858883f8980e0b59","user":{"login":"pivotal-ning-yu","id":25739550,"node_id":"MDQ6VXNlcjI1NzM5NTUw","avatar_url":"https://avatars2.githubusercontent.com/u/25739550?v=4","gravatar_id":"","url":"https://api.github.com/users/pivotal-ning-yu","html_url":"https://github.com/pivotal-ning-yu","followers_url":"https://api.github.com/users/pivotal-ning-yu/followers","following_url":"https://api.github.com/users/pivotal-ning-yu/following{/other_user}","gists_url":"https://api.github.com/users/pivotal-ning-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotal-ning-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotal-ning-yu/subscriptions","organizations_url":"https://api.github.com/users/pivotal-ning-yu/orgs","repos_url":"https://api.github.com/users/pivotal-ning-yu/repos","events_url":"https://api.github.com/users/pivotal-ning-yu/events{/privacy}","received_events_url":"https://api.github.com/users/pivotal-ning-yu/received_events","type":"User","site_admin":false},"repo":{"id":82621389,"node_id":"MDEwOlJlcG9zaXRvcnk4MjYyMTM4OQ==","name":"gpdb","full_name":"pivotal-ning-yu/gpdb","private":false,"owner":{"login":"pivotal-ning-yu","id":25739550,"node_id":"MDQ6VXNlcjI1NzM5NTUw","avatar_url":"https://avatars2.githubusercontent.com/u/25739550?v=4","gravatar_id":"","url":"https://api.github.com/users/pivotal-ning-yu","html_url":"https://github.com/pivotal-ning-yu","followers_url":"https://api.github.com/users/pivotal-ning-yu/followers","following_url":"https://api.github.com/users/pivotal-ning-yu/following{/other_user}","gists_url":"https://api.github.com/users/pivotal-ning-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotal-ning-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotal-ning-yu/subscriptions","organizations_url":"https://api.github.com/users/pivotal-ning-yu/orgs","repos_url":"https://api.github.com/users/pivotal-ning-yu/repos","events_url":"https://api.github.com/users/pivotal-ning-yu/events{/privacy}","received_events_url":"https://api.github.com/users/pivotal-ning-yu/received_events","type":"User","site_admin":false},"html_url":"https://github.com/pivotal-ning-yu/gpdb","description":"Greenplum Database","fork":true,"url":"https://api.github.com/repos/pivotal-ning-yu/gpdb","forks_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/forks","keys_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/teams","hooks_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/hooks","issue_events_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/events","assignees_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/tags","blobs_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/languages","stargazers_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/stargazers","contributors_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/contributors","subscribers_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/subscribers","subscription_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/subscription","commits_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/merges","archive_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/downloads","issues_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/releases{/id}","deployments_url":"https://api.github.com/repos/pivotal-ning-yu/gpdb/deployments","created_at":"2017-02-21T01:25:54Z","updated_at":"2018-07-27T00:45:49Z","pushed_at":"2018-11-29T01:26:29Z","git_url":"git://github.com/pivotal-ning-yu/gpdb.git","ssh_url":"git@github.com:pivotal-ning-yu/gpdb.git","clone_url":"https://github.com/pivotal-ning-yu/gpdb.git","svn_url":"https://github.com/pivotal-ning-yu/gpdb","homepage":"http://greenplum.org","size":331673,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"greenplum-db:master","ref":"master","sha":"799abec1aa2b4a03b7b43025a907890306b0e9f6","user":{"login":"greenplum-db","id":14097842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDk3ODQy","avatar_url":"https://avatars2.githubusercontent.com/u/14097842?v=4","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"repo":{"id":44781140,"node_id":"MDEwOlJlcG9zaXRvcnk0NDc4MTE0MA==","name":"gpdb","full_name":"greenplum-db/gpdb","private":false,"owner":{"login":"greenplum-db","id":14097842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDk3ODQy","avatar_url":"https://avatars2.githubusercontent.com/u/14097842?v=4","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/greenplum-db/gpdb","description":"Greenplum Database","fork":false,"url":"https://api.github.com/repos/greenplum-db/gpdb","forks_url":"https://api.github.com/repos/greenplum-db/gpdb/forks","keys_url":"https://api.github.com/repos/greenplum-db/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gpdb/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gpdb/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gpdb/events","assignees_url":"https://api.github.com/repos/greenplum-db/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gpdb/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gpdb/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gpdb/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gpdb/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gpdb/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gpdb/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gpdb/merges","archive_url":"https://api.github.com/repos/greenplum-db/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gpdb/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gpdb/releases{/id}","deployments_url":"https://api.github.com/repos/greenplum-db/gpdb/deployments","created_at":"2015-10-23T00:25:17Z","updated_at":"2018-11-29T00:34:35Z","pushed_at":"2018-11-29T00:43:10Z","git_url":"git://github.com/greenplum-db/gpdb.git","ssh_url":"git@github.com:greenplum-db/gpdb.git","clone_url":"https://github.com/greenplum-db/gpdb.git","svn_url":"https://github.com/greenplum-db/gpdb","homepage":"http://greenplum.org","size":332417,"stargazers_count":2811,"watchers_count":2811,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":857,"mirror_url":null,"archived":false,"open_issues_count":272,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":857,"open_issues":272,"watchers":2811,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/6363"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/6363"},"issue":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/6363"},"comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/6363/comments"},"review_comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/6363/comments"},"review_comment":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/6363/commits"},"statuses":{"href":"https://api.github.com/repos/greenplum-db/gpdb/statuses/1e32657d3253a9a4435dd559858883f8980e0b59"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":2,"additions":289,"deletions":25,"changed_files":4}}
{"actor":{"display_login":"pivotal-ning-yu"}}