{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments/57931410","id":57931410,"diff_hunk":"@@ -10165,22 +10165,35 @@ base table then the old version of the row will have to be deleted from\n indexes, and a new version inserted. Upsert is being transformed to merge\n so that we can delete the old version of an updated row from the index.\n \n-Upsert is also converted into merge when there are omitted cols with default values and \n-TRAF_UPSERT_WITH_INSERT_DEFAULT_SEMANTICS is set to  OFF in case of aligned format table or \n+Upsert is also converted into merge when TRAF_UPSERT_MODE is set to MERGE and \n+there are omitted cols with default values in case of aligned format table or \n omitted current timestamp cols in case of non-aligned row format\n */\n NABoolean Insert::isUpsertThatNeedsMerge(NABoolean isAlignedRowFormat, NABoolean omittedDefaultCols,\n                                    NABoolean omittedCurrentDefaultClassCols) const\n {\n+  // The necessary conditions to convert upsert to merge and\n   if (isUpsert() && \n       (NOT getIsTrafLoadPrep()) && \n       (NOT (getTableDesc()->isIdentityColumnGeneratedAlways() && getTableDesc()->hasIdentityColumnInClusteringKey())) && \n       (NOT (getTableDesc()->getClusteringIndex()->getNAFileSet()->hasSyskey())) && \n-       ((getTableDesc()->hasSecondaryIndexes()) ||\n-         (( NOT isAlignedRowFormat) && omittedCurrentDefaultClassCols) ||\n-             ((isAlignedRowFormat && omittedDefaultCols\n-              && (CmpCommon::getDefault(TRAF_UPSERT_WITH_INSERT_DEFAULT_SEMANTICS) == DF_OFF)))\n-       ))\n+        // table has secondary indexes or\n+        (getTableDesc()->hasSecondaryIndexes() ||\n+          // CQD is set to MERGE  \n+          ((CmpCommon::getDefault(TRAF_UPSERT_MODE) == DF_MERGE) &&\n+            // omitted current default columns with non-aligned row format tables\n+            // or omitted default columns with aligned row format tables \n+            (((NOT isAlignedRowFormat) && omittedCurrentDefaultClassCols) ||\n+            (isAlignedRowFormat && omittedDefaultCols))) ||\n+          // CQD is set to Optimal, for non-aligned row format with omitted \n+          // current columns, it is converted into merge though it is not\n+          // optimal for performance - This is done to ensure that when the \n+          // CQD is set to optimal, non-aligned format would behave like \n+          // merge when any column is  omitted ","path":"core/sql/optimizer/BindRelExpr.cpp","position":44,"original_position":44,"commit_id":"99224dddd97ac3910a8b25a7d765e8be50695c1e","original_commit_id":"99224dddd97ac3910a8b25a7d765e8be50695c1e","user":{"login":"sureshsubbiah","id":3596671,"avatar_url":"https://avatars.githubusercontent.com/u/3596671?v=3","gravatar_id":"","url":"https://api.github.com/users/sureshsubbiah","html_url":"https://github.com/sureshsubbiah","followers_url":"https://api.github.com/users/sureshsubbiah/followers","following_url":"https://api.github.com/users/sureshsubbiah/following{/other_user}","gists_url":"https://api.github.com/users/sureshsubbiah/gists{/gist_id}","starred_url":"https://api.github.com/users/sureshsubbiah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sureshsubbiah/subscriptions","organizations_url":"https://api.github.com/users/sureshsubbiah/orgs","repos_url":"https://api.github.com/users/sureshsubbiah/repos","events_url":"https://api.github.com/users/sureshsubbiah/events{/privacy}","received_events_url":"https://api.github.com/users/sureshsubbiah/received_events","type":"User","site_admin":false},"body":"I suppose the comment in line 10192 should say \"when any current default column is omitted\" ?\r\n\r\nA table some place in code that shows what the behaviour is with 3 cqd settings for aligned omitted default, aligned omitted default current non-aligned omitted default, non-aligned omitted current default will be helpful.  ","created_at":"2016-03-30T17:43:40Z","updated_at":"2016-03-30T17:43:40Z","html_url":"https://github.com/apache/incubator-trafodion/pull/393#discussion_r57931410","pull_request_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/393","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments/57931410"},"html":{"href":"https://github.com/apache/incubator-trafodion/pull/393#discussion_r57931410"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/393"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/393","id":63369712,"html_url":"https://github.com/apache/incubator-trafodion/pull/393","diff_url":"https://github.com/apache/incubator-trafodion/pull/393.diff","patch_url":"https://github.com/apache/incubator-trafodion/pull/393.patch","issue_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/393","number":393,"state":"open","locked":false,"title":"[TRAFODION-1896] CQD TRAF_UPSERT_WITH_INSERT_DEFAULT_SEMANTICS for no…","user":{"login":"selvaganesang","id":8702996,"avatar_url":"https://avatars.githubusercontent.com/u/8702996?v=3","gravatar_id":"","url":"https://api.github.com/users/selvaganesang","html_url":"https://github.com/selvaganesang","followers_url":"https://api.github.com/users/selvaganesang/followers","following_url":"https://api.github.com/users/selvaganesang/following{/other_user}","gists_url":"https://api.github.com/users/selvaganesang/gists{/gist_id}","starred_url":"https://api.github.com/users/selvaganesang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selvaganesang/subscriptions","organizations_url":"https://api.github.com/users/selvaganesang/orgs","repos_url":"https://api.github.com/users/selvaganesang/repos","events_url":"https://api.github.com/users/selvaganesang/events{/privacy}","received_events_url":"https://api.github.com/users/selvaganesang/received_events","type":"User","site_admin":false},"body":"…n-aligned format\r\n\r\nThis CQD is now honored for non-aligned format by replacing the column\r\nvalue with default values for omitted columns and put into hbase table.","created_at":"2016-03-18T12:52:10Z","updated_at":"2016-03-30T17:43:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07d07bbdf6732196c1ff530a1ad3d28494438c1c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/393/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/393/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/393/comments","statuses_url":"https://api.github.com/repos/apache/incubator-trafodion/statuses/99224dddd97ac3910a8b25a7d765e8be50695c1e","head":{"label":"selvaganesang:trafodion-1896","ref":"trafodion-1896","sha":"99224dddd97ac3910a8b25a7d765e8be50695c1e","user":{"login":"selvaganesang","id":8702996,"avatar_url":"https://avatars.githubusercontent.com/u/8702996?v=3","gravatar_id":"","url":"https://api.github.com/users/selvaganesang","html_url":"https://github.com/selvaganesang","followers_url":"https://api.github.com/users/selvaganesang/followers","following_url":"https://api.github.com/users/selvaganesang/following{/other_user}","gists_url":"https://api.github.com/users/selvaganesang/gists{/gist_id}","starred_url":"https://api.github.com/users/selvaganesang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selvaganesang/subscriptions","organizations_url":"https://api.github.com/users/selvaganesang/orgs","repos_url":"https://api.github.com/users/selvaganesang/repos","events_url":"https://api.github.com/users/selvaganesang/events{/privacy}","received_events_url":"https://api.github.com/users/selvaganesang/received_events","type":"User","site_admin":false},"repo":{"id":37948798,"name":"incubator-trafodion","full_name":"selvaganesang/incubator-trafodion","owner":{"login":"selvaganesang","id":8702996,"avatar_url":"https://avatars.githubusercontent.com/u/8702996?v=3","gravatar_id":"","url":"https://api.github.com/users/selvaganesang","html_url":"https://github.com/selvaganesang","followers_url":"https://api.github.com/users/selvaganesang/followers","following_url":"https://api.github.com/users/selvaganesang/following{/other_user}","gists_url":"https://api.github.com/users/selvaganesang/gists{/gist_id}","starred_url":"https://api.github.com/users/selvaganesang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selvaganesang/subscriptions","organizations_url":"https://api.github.com/users/selvaganesang/orgs","repos_url":"https://api.github.com/users/selvaganesang/repos","events_url":"https://api.github.com/users/selvaganesang/events{/privacy}","received_events_url":"https://api.github.com/users/selvaganesang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/selvaganesang/incubator-trafodion","description":"Mirror of Apache Trafodion (Incubating)","fork":true,"url":"https://api.github.com/repos/selvaganesang/incubator-trafodion","forks_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/forks","keys_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/teams","hooks_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/hooks","issue_events_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/issues/events{/number}","events_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/events","assignees_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/assignees{/user}","branches_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/branches{/branch}","tags_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/tags","blobs_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/git/refs{/sha}","trees_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/statuses/{sha}","languages_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/languages","stargazers_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/stargazers","contributors_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/contributors","subscribers_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/subscribers","subscription_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/subscription","commits_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/commits{/sha}","git_commits_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/git/commits{/sha}","comments_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/comments{/number}","issue_comment_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/issues/comments{/number}","contents_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/contents/{+path}","compare_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/merges","archive_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/downloads","issues_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/issues{/number}","pulls_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/pulls{/number}","milestones_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/milestones{/number}","notifications_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/labels{/name}","releases_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/releases{/id}","deployments_url":"https://api.github.com/repos/selvaganesang/incubator-trafodion/deployments","created_at":"2015-06-23T22:34:16Z","updated_at":"2015-06-23T22:34:56Z","pushed_at":"2016-03-30T16:31:28Z","git_url":"git://github.com/selvaganesang/incubator-trafodion.git","ssh_url":"git@github.com:selvaganesang/incubator-trafodion.git","clone_url":"https://github.com/selvaganesang/incubator-trafodion.git","svn_url":"https://github.com/selvaganesang/incubator-trafodion","homepage":null,"size":68701,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"f918a261ec1069f3111b5a588136d32fe439d0d6","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":36349344,"name":"incubator-trafodion","full_name":"apache/incubator-trafodion","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-trafodion","description":"Mirror of Apache Trafodion (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-trafodion","forks_url":"https://api.github.com/repos/apache/incubator-trafodion/forks","keys_url":"https://api.github.com/repos/apache/incubator-trafodion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-trafodion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-trafodion/teams","hooks_url":"https://api.github.com/repos/apache/incubator-trafodion/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-trafodion/events","assignees_url":"https://api.github.com/repos/apache/incubator-trafodion/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-trafodion/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-trafodion/tags","blobs_url":"https://api.github.com/repos/apache/incubator-trafodion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-trafodion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-trafodion/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-trafodion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-trafodion/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-trafodion/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-trafodion/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-trafodion/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-trafodion/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-trafodion/subscription","commits_url":"https://api.github.com/repos/apache/incubator-trafodion/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-trafodion/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-trafodion/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-trafodion/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-trafodion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-trafodion/merges","archive_url":"https://api.github.com/repos/apache/incubator-trafodion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-trafodion/downloads","issues_url":"https://api.github.com/repos/apache/incubator-trafodion/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-trafodion/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-trafodion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-trafodion/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-trafodion/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-trafodion/deployments","created_at":"2015-05-27T07:00:05Z","updated_at":"2016-03-29T08:00:51Z","pushed_at":"2016-03-30T17:31:45Z","git_url":"git://github.com/apache/incubator-trafodion.git","ssh_url":"git@github.com:apache/incubator-trafodion.git","clone_url":"https://github.com/apache/incubator-trafodion.git","svn_url":"https://github.com/apache/incubator-trafodion","homepage":null,"size":70305,"stargazers_count":30,"watchers_count":30,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":61,"mirror_url":"git://git.apache.org/incubator-trafodion.git","open_issues_count":9,"forks":61,"open_issues":9,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/393"},"html":{"href":"https://github.com/apache/incubator-trafodion/pull/393"},"issue":{"href":"https://api.github.com/repos/apache/incubator-trafodion/issues/393"},"comments":{"href":"https://api.github.com/repos/apache/incubator-trafodion/issues/393/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/393/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/393/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-trafodion/statuses/99224dddd97ac3910a8b25a7d765e8be50695c1e"}}}}