{"action":"created","comment":{"url":"https://api.github.com/repos/greenplum-db/gporca/pulls/comments/62543540","id":62543540,"diff_hunk":"@@ -0,0 +1,67 @@\n+//---------------------------------------------------------------------------\n+//\tGreenplum Database\n+//\tCopyright (C) 2016 Pivotal Inc.\n+//\n+//\t@filename:\n+//\t\tCMDUtilsGPDB.cpp\n+//\n+//\t@doc:\n+//\t\tImplementation of utility functions that are used by GPDB related metadata\n+//\n+//---------------------------------------------------------------------------\n+\n+#include \"naucrates/md/CMDUtilsGPDB.h\"\n+\n+using namespace gpdxl;\n+using namespace gpmd;\n+\n+//---------------------------------------------------------------------------\n+//\t@function:\n+//\t\tCMDUtilsGPDB::InitializeMDColInfo\n+//\n+//\t@doc:\n+//\t\tFrom the array of metadata columns populate the following output variables\n+//\t\tphmiulAttno2Pos - attribute number to column array position mapping\n+//\t\tpdrgpulNonDroppedCols - array of non-dropped columns\n+//\t\tphmululNonDroppedCols - column array position mapping to position array of non-dropped columns\n+//---------------------------------------------------------------------------\n+void\n+CMDUtilsGPDB::InitializeMDColInfo\n+\t(\n+\tIMemoryPool *pmp,\n+\tDrgPmdcol *pdrgpmdcol,\n+\tHMIUl *phmiulAttno2Pos,\n+\tDrgPul *pdrgpulNonDroppedCols,\n+\tHMUlUl *phmululNonDroppedCols\n+\t)\n+{\n+\tGPOS_ASSERT(NULL != pdrgpmdcol);\n+\tGPOS_ASSERT(NULL != phmiulAttno2Pos);\n+\tGPOS_ASSERT(NULL != pdrgpulNonDroppedCols);\n+\n+\tconst ULONG ulArity = pdrgpmdcol->UlLength();\n+\tULONG ulPosNonDropped = 0;\n+\tfor (ULONG ul = 0; ul < ulArity; ul++)\n+\t{\n+\t\tconst IMDColumn *pmdcol = (*pdrgpmdcol)[ul];\n+\n+\t\t(void) phmiulAttno2Pos->FInsert\n+\t\t\t\t\t\t\t\t(","path":"libnaucrates/src/md/CMDUtilsGPDB.cpp","position":49,"original_position":49,"commit_id":"1ce9a4ba44faff053b74a4975760dee4a9145611","original_commit_id":"1ce9a4ba44faff053b74a4975760dee4a9145611","user":{"login":"oarap","id":16888138,"avatar_url":"https://avatars.githubusercontent.com/u/16888138?v=3","gravatar_id":"","url":"https://api.github.com/users/oarap","html_url":"https://github.com/oarap","followers_url":"https://api.github.com/users/oarap/followers","following_url":"https://api.github.com/users/oarap/following{/other_user}","gists_url":"https://api.github.com/users/oarap/gists{/gist_id}","starred_url":"https://api.github.com/users/oarap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oarap/subscriptions","organizations_url":"https://api.github.com/users/oarap/orgs","repos_url":"https://api.github.com/users/oarap/repos","events_url":"https://api.github.com/users/oarap/events{/privacy}","received_events_url":"https://api.github.com/users/oarap/received_events","type":"User","site_admin":false},"body":"too much indent","created_at":"2016-05-09T18:00:05Z","updated_at":"2016-05-09T18:00:05Z","html_url":"https://github.com/greenplum-db/gporca/pull/47#discussion_r62543540","pull_request_url":"https://api.github.com/repos/greenplum-db/gporca/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/comments/62543540"},"html":{"href":"https://github.com/greenplum-db/gporca/pull/47#discussion_r62543540"},"pull_request":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gporca/pulls/47","id":69232203,"html_url":"https://github.com/greenplum-db/gporca/pull/47","diff_url":"https://github.com/greenplum-db/gporca/pull/47.diff","patch_url":"https://github.com/greenplum-db/gporca/pull/47.patch","issue_url":"https://api.github.com/repos/greenplum-db/gporca/issues/47","number":47,"state":"open","locked":false,"title":"IMDRelation Cleanup","user":{"login":"vraghavan78","id":12649877,"avatar_url":"https://avatars.githubusercontent.com/u/12649877?v=3","gravatar_id":"","url":"https://api.github.com/users/vraghavan78","html_url":"https://github.com/vraghavan78","followers_url":"https://api.github.com/users/vraghavan78/followers","following_url":"https://api.github.com/users/vraghavan78/following{/other_user}","gists_url":"https://api.github.com/users/vraghavan78/gists{/gist_id}","starred_url":"https://api.github.com/users/vraghavan78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vraghavan78/subscriptions","organizations_url":"https://api.github.com/users/vraghavan78/orgs","repos_url":"https://api.github.com/users/vraghavan78/repos","events_url":"https://api.github.com/users/vraghavan78/events{/privacy}","received_events_url":"https://api.github.com/users/vraghavan78/received_events","type":"User","site_admin":false},"body":"Tracker Story: [#118416535]\r\n\r\nObjectives:\r\n\r\nA) Pull up the common logic in the following classes into a util function\r\n* CMDRelationGPDB\r\n* CMDRelationCtasGPDB\r\n* CMDRelationExternalGPDB\r\n\r\nB) There was several GPDB specific implicit assumption made such as system columns are always in the end\r\n\r\nC) Unclean API resulting in the same logic of identifying which is a non-dropped column being re-written in many places (as shown in #117875199, missing column statistics, etc.)\r\n\r\n@d @xinzweb @oarap @hsyuan please take a look.","created_at":"2016-05-07T03:54:24Z","updated_at":"2016-05-09T18:00:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"452ec38e077381aa0f6dbf263d185efca22f92e7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/greenplum-db/gporca/pulls/47/commits","review_comments_url":"https://api.github.com/repos/greenplum-db/gporca/pulls/47/comments","review_comment_url":"https://api.github.com/repos/greenplum-db/gporca/pulls/comments{/number}","comments_url":"https://api.github.com/repos/greenplum-db/gporca/issues/47/comments","statuses_url":"https://api.github.com/repos/greenplum-db/gporca/statuses/1ce9a4ba44faff053b74a4975760dee4a9145611","head":{"label":"vraghavan78:IMDCleanup-119090047","ref":"IMDCleanup-119090047","sha":"1ce9a4ba44faff053b74a4975760dee4a9145611","user":{"login":"vraghavan78","id":12649877,"avatar_url":"https://avatars.githubusercontent.com/u/12649877?v=3","gravatar_id":"","url":"https://api.github.com/users/vraghavan78","html_url":"https://github.com/vraghavan78","followers_url":"https://api.github.com/users/vraghavan78/followers","following_url":"https://api.github.com/users/vraghavan78/following{/other_user}","gists_url":"https://api.github.com/users/vraghavan78/gists{/gist_id}","starred_url":"https://api.github.com/users/vraghavan78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vraghavan78/subscriptions","organizations_url":"https://api.github.com/users/vraghavan78/orgs","repos_url":"https://api.github.com/users/vraghavan78/repos","events_url":"https://api.github.com/users/vraghavan78/events{/privacy}","received_events_url":"https://api.github.com/users/vraghavan78/received_events","type":"User","site_admin":false},"repo":{"id":52817990,"name":"gporca","full_name":"vraghavan78/gporca","owner":{"login":"vraghavan78","id":12649877,"avatar_url":"https://avatars.githubusercontent.com/u/12649877?v=3","gravatar_id":"","url":"https://api.github.com/users/vraghavan78","html_url":"https://github.com/vraghavan78","followers_url":"https://api.github.com/users/vraghavan78/followers","following_url":"https://api.github.com/users/vraghavan78/following{/other_user}","gists_url":"https://api.github.com/users/vraghavan78/gists{/gist_id}","starred_url":"https://api.github.com/users/vraghavan78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vraghavan78/subscriptions","organizations_url":"https://api.github.com/users/vraghavan78/orgs","repos_url":"https://api.github.com/users/vraghavan78/repos","events_url":"https://api.github.com/users/vraghavan78/events{/privacy}","received_events_url":"https://api.github.com/users/vraghavan78/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vraghavan78/gporca","description":"A modular query optimizer for big data","fork":true,"url":"https://api.github.com/repos/vraghavan78/gporca","forks_url":"https://api.github.com/repos/vraghavan78/gporca/forks","keys_url":"https://api.github.com/repos/vraghavan78/gporca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vraghavan78/gporca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vraghavan78/gporca/teams","hooks_url":"https://api.github.com/repos/vraghavan78/gporca/hooks","issue_events_url":"https://api.github.com/repos/vraghavan78/gporca/issues/events{/number}","events_url":"https://api.github.com/repos/vraghavan78/gporca/events","assignees_url":"https://api.github.com/repos/vraghavan78/gporca/assignees{/user}","branches_url":"https://api.github.com/repos/vraghavan78/gporca/branches{/branch}","tags_url":"https://api.github.com/repos/vraghavan78/gporca/tags","blobs_url":"https://api.github.com/repos/vraghavan78/gporca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vraghavan78/gporca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vraghavan78/gporca/git/refs{/sha}","trees_url":"https://api.github.com/repos/vraghavan78/gporca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vraghavan78/gporca/statuses/{sha}","languages_url":"https://api.github.com/repos/vraghavan78/gporca/languages","stargazers_url":"https://api.github.com/repos/vraghavan78/gporca/stargazers","contributors_url":"https://api.github.com/repos/vraghavan78/gporca/contributors","subscribers_url":"https://api.github.com/repos/vraghavan78/gporca/subscribers","subscription_url":"https://api.github.com/repos/vraghavan78/gporca/subscription","commits_url":"https://api.github.com/repos/vraghavan78/gporca/commits{/sha}","git_commits_url":"https://api.github.com/repos/vraghavan78/gporca/git/commits{/sha}","comments_url":"https://api.github.com/repos/vraghavan78/gporca/comments{/number}","issue_comment_url":"https://api.github.com/repos/vraghavan78/gporca/issues/comments{/number}","contents_url":"https://api.github.com/repos/vraghavan78/gporca/contents/{+path}","compare_url":"https://api.github.com/repos/vraghavan78/gporca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vraghavan78/gporca/merges","archive_url":"https://api.github.com/repos/vraghavan78/gporca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vraghavan78/gporca/downloads","issues_url":"https://api.github.com/repos/vraghavan78/gporca/issues{/number}","pulls_url":"https://api.github.com/repos/vraghavan78/gporca/pulls{/number}","milestones_url":"https://api.github.com/repos/vraghavan78/gporca/milestones{/number}","notifications_url":"https://api.github.com/repos/vraghavan78/gporca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vraghavan78/gporca/labels{/name}","releases_url":"https://api.github.com/repos/vraghavan78/gporca/releases{/id}","deployments_url":"https://api.github.com/repos/vraghavan78/gporca/deployments","created_at":"2016-02-29T19:34:19Z","updated_at":"2016-02-29T19:34:47Z","pushed_at":"2016-05-07T04:15:15Z","git_url":"git://github.com/vraghavan78/gporca.git","ssh_url":"git@github.com:vraghavan78/gporca.git","clone_url":"https://github.com/vraghavan78/gporca.git","svn_url":"https://github.com/vraghavan78/gporca","homepage":"","size":17884,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"greenplum-db:master","ref":"master","sha":"898a277165a0aefd79e05835b89df3a1b060855c","user":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars.githubusercontent.com/u/14097842?v=3","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":47849203,"name":"gporca","full_name":"greenplum-db/gporca","owner":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars.githubusercontent.com/u/14097842?v=3","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},"private":false,"html_url":"https://github.com/greenplum-db/gporca","description":"A modular query optimizer for big data","fork":false,"url":"https://api.github.com/repos/greenplum-db/gporca","forks_url":"https://api.github.com/repos/greenplum-db/gporca/forks","keys_url":"https://api.github.com/repos/greenplum-db/gporca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gporca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gporca/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gporca/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gporca/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gporca/events","assignees_url":"https://api.github.com/repos/greenplum-db/gporca/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gporca/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gporca/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gporca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gporca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gporca/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gporca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gporca/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gporca/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gporca/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gporca/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gporca/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gporca/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gporca/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gporca/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gporca/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gporca/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gporca/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gporca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gporca/merges","archive_url":"https://api.github.com/repos/greenplum-db/gporca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gporca/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gporca/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gporca/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gporca/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gporca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gporca/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gporca/releases{/id}","deployments_url":"https://api.github.com/repos/greenplum-db/gporca/deployments","created_at":"2015-12-11T20:24:47Z","updated_at":"2016-05-04T06:05:11Z","pushed_at":"2016-05-09T17:45:46Z","git_url":"git://github.com/greenplum-db/gporca.git","ssh_url":"git@github.com:greenplum-db/gporca.git","clone_url":"https://github.com/greenplum-db/gporca.git","svn_url":"https://github.com/greenplum-db/gporca","homepage":"","size":17907,"stargazers_count":57,"watchers_count":57,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":4,"forks":33,"open_issues":4,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/47"},"html":{"href":"https://github.com/greenplum-db/gporca/pull/47"},"issue":{"href":"https://api.github.com/repos/greenplum-db/gporca/issues/47"},"comments":{"href":"https://api.github.com/repos/greenplum-db/gporca/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/greenplum-db/gporca/statuses/1ce9a4ba44faff053b74a4975760dee4a9145611"}}}}