{"action":"created","comment":{"url":"https://api.github.com/repos/apache/drill/pulls/comments/43714617","id":43714617,"diff_hunk":"@@ -218,11 +220,16 @@ public HoldingContainer addExpr(LogicalExpression ex) {\n   }\n \n   public HoldingContainer addExpr(LogicalExpression ex, boolean rotate) {\n+    return addExpr(ex, rotate, false);","path":"exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java","position":18,"original_position":18,"commit_id":"b335f704baf643ebbfa589162a686708a00a0fab","original_commit_id":"b335f704baf643ebbfa589162a686708a00a0fab","user":{"login":"jinfengni","id":5742011,"avatar_url":"https://avatars.githubusercontent.com/u/5742011?v=3","gravatar_id":"","url":"https://api.github.com/users/jinfengni","html_url":"https://github.com/jinfengni","followers_url":"https://api.github.com/users/jinfengni/followers","following_url":"https://api.github.com/users/jinfengni/following{/other_user}","gists_url":"https://api.github.com/users/jinfengni/gists{/gist_id}","starred_url":"https://api.github.com/users/jinfengni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinfengni/subscriptions","organizations_url":"https://api.github.com/users/jinfengni/orgs","repos_url":"https://api.github.com/users/jinfengni/repos","events_url":"https://api.github.com/users/jinfengni/events{/privacy}","received_events_url":"https://api.github.com/users/jinfengni/received_events","type":"User","site_admin":false},"body":"I think this had better to be addExpr(ex, rotate, true). That is, be default, we turn on CSE. Otherwise, seems the patch only turns on CSE for Project, Filter, HashAgg, HashJoin, but not for other operators. \r\n\r\nIs there any reason that we do not by default turn on CSE here?\r\n","created_at":"2015-11-03T04:05:11Z","updated_at":"2015-11-03T04:05:11Z","html_url":"https://github.com/apache/drill/pull/189#discussion_r43714617","pull_request_url":"https://api.github.com/repos/apache/drill/pulls/189","_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/comments/43714617"},"html":{"href":"https://github.com/apache/drill/pull/189#discussion_r43714617"},"pull_request":{"href":"https://api.github.com/repos/apache/drill/pulls/189"}}},"pull_request":{"url":"https://api.github.com/repos/apache/drill/pulls/189","id":47087219,"html_url":"https://github.com/apache/drill/pull/189","diff_url":"https://github.com/apache/drill/pull/189.diff","patch_url":"https://github.com/apache/drill/pull/189.patch","issue_url":"https://api.github.com/repos/apache/drill/issues/189","number":189,"state":"open","locked":false,"title":"DRILL-3912: Common subexpression elimination","user":{"login":"StevenMPhillips","id":3360419,"avatar_url":"https://avatars.githubusercontent.com/u/3360419?v=3","gravatar_id":"","url":"https://api.github.com/users/StevenMPhillips","html_url":"https://github.com/StevenMPhillips","followers_url":"https://api.github.com/users/StevenMPhillips/followers","following_url":"https://api.github.com/users/StevenMPhillips/following{/other_user}","gists_url":"https://api.github.com/users/StevenMPhillips/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenMPhillips/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenMPhillips/subscriptions","organizations_url":"https://api.github.com/users/StevenMPhillips/orgs","repos_url":"https://api.github.com/users/StevenMPhillips/repos","events_url":"https://api.github.com/users/StevenMPhillips/events{/privacy}","received_events_url":"https://api.github.com/users/StevenMPhillips/received_events","type":"User","site_admin":false},"body":"In EvaluationVisitor, map each logical expression subtree to the HoldingContainer produced when the subtree is evaluated, and store it in a HashMap.\r\n\r\nTow new classes, HashVisitor and EqualityVisitor are used to determine the hashcode and equality for the map. Two logical expression trees are equal if all child nodes are equal, and the root nodes are the same type and have the same fields.\r\n\r\nOnly expressions that are in scope are available in the map. When entering a new scope, the current map is copied into a new map. The current map is pushed onto a stack, and the new map becomes the current map. When that scope is left, the previous map is popped off the stack and becomes the current scope. Thus previously evaluated expression in the outer scope are available while in the inner scope, but any new expressions will not be available when in the outer scope.\r\n\r\nA new scope is entered when evaluating a boolean expression, or when evaluating either branch of an If Expression.","created_at":"2015-10-07T21:52:36Z","updated_at":"2015-11-03T04:05:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cb35ee42bf590430f14d6c4267fb9e82b01691a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/drill/pulls/189/commits","review_comments_url":"https://api.github.com/repos/apache/drill/pulls/189/comments","review_comment_url":"https://api.github.com/repos/apache/drill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/drill/issues/189/comments","statuses_url":"https://api.github.com/repos/apache/drill/statuses/b335f704baf643ebbfa589162a686708a00a0fab","head":{"label":"StevenMPhillips:drill-3912","ref":"drill-3912","sha":"b335f704baf643ebbfa589162a686708a00a0fab","user":{"login":"StevenMPhillips","id":3360419,"avatar_url":"https://avatars.githubusercontent.com/u/3360419?v=3","gravatar_id":"","url":"https://api.github.com/users/StevenMPhillips","html_url":"https://github.com/StevenMPhillips","followers_url":"https://api.github.com/users/StevenMPhillips/followers","following_url":"https://api.github.com/users/StevenMPhillips/following{/other_user}","gists_url":"https://api.github.com/users/StevenMPhillips/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenMPhillips/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenMPhillips/subscriptions","organizations_url":"https://api.github.com/users/StevenMPhillips/orgs","repos_url":"https://api.github.com/users/StevenMPhillips/repos","events_url":"https://api.github.com/users/StevenMPhillips/events{/privacy}","received_events_url":"https://api.github.com/users/StevenMPhillips/received_events","type":"User","site_admin":false},"repo":{"id":11778179,"name":"drill","full_name":"StevenMPhillips/drill","owner":{"login":"StevenMPhillips","id":3360419,"avatar_url":"https://avatars.githubusercontent.com/u/3360419?v=3","gravatar_id":"","url":"https://api.github.com/users/StevenMPhillips","html_url":"https://github.com/StevenMPhillips","followers_url":"https://api.github.com/users/StevenMPhillips/followers","following_url":"https://api.github.com/users/StevenMPhillips/following{/other_user}","gists_url":"https://api.github.com/users/StevenMPhillips/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenMPhillips/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenMPhillips/subscriptions","organizations_url":"https://api.github.com/users/StevenMPhillips/orgs","repos_url":"https://api.github.com/users/StevenMPhillips/repos","events_url":"https://api.github.com/users/StevenMPhillips/events{/privacy}","received_events_url":"https://api.github.com/users/StevenMPhillips/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/StevenMPhillips/drill","description":"Mirror of Apache Drill","fork":true,"url":"https://api.github.com/repos/StevenMPhillips/drill","forks_url":"https://api.github.com/repos/StevenMPhillips/drill/forks","keys_url":"https://api.github.com/repos/StevenMPhillips/drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StevenMPhillips/drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StevenMPhillips/drill/teams","hooks_url":"https://api.github.com/repos/StevenMPhillips/drill/hooks","issue_events_url":"https://api.github.com/repos/StevenMPhillips/drill/issues/events{/number}","events_url":"https://api.github.com/repos/StevenMPhillips/drill/events","assignees_url":"https://api.github.com/repos/StevenMPhillips/drill/assignees{/user}","branches_url":"https://api.github.com/repos/StevenMPhillips/drill/branches{/branch}","tags_url":"https://api.github.com/repos/StevenMPhillips/drill/tags","blobs_url":"https://api.github.com/repos/StevenMPhillips/drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StevenMPhillips/drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StevenMPhillips/drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/StevenMPhillips/drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StevenMPhillips/drill/statuses/{sha}","languages_url":"https://api.github.com/repos/StevenMPhillips/drill/languages","stargazers_url":"https://api.github.com/repos/StevenMPhillips/drill/stargazers","contributors_url":"https://api.github.com/repos/StevenMPhillips/drill/contributors","subscribers_url":"https://api.github.com/repos/StevenMPhillips/drill/subscribers","subscription_url":"https://api.github.com/repos/StevenMPhillips/drill/subscription","commits_url":"https://api.github.com/repos/StevenMPhillips/drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/StevenMPhillips/drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/StevenMPhillips/drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/StevenMPhillips/drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/StevenMPhillips/drill/contents/{+path}","compare_url":"https://api.github.com/repos/StevenMPhillips/drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StevenMPhillips/drill/merges","archive_url":"https://api.github.com/repos/StevenMPhillips/drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StevenMPhillips/drill/downloads","issues_url":"https://api.github.com/repos/StevenMPhillips/drill/issues{/number}","pulls_url":"https://api.github.com/repos/StevenMPhillips/drill/pulls{/number}","milestones_url":"https://api.github.com/repos/StevenMPhillips/drill/milestones{/number}","notifications_url":"https://api.github.com/repos/StevenMPhillips/drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StevenMPhillips/drill/labels{/name}","releases_url":"https://api.github.com/repos/StevenMPhillips/drill/releases{/id}","created_at":"2013-07-30T23:45:47Z","updated_at":"2015-08-17T21:47:36Z","pushed_at":"2015-11-03T03:14:01Z","git_url":"git://github.com/StevenMPhillips/drill.git","ssh_url":"git@github.com:StevenMPhillips/drill.git","clone_url":"https://github.com/StevenMPhillips/drill.git","svn_url":"https://github.com/StevenMPhillips/drill","homepage":"","size":41809,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"1d067d26b1ba510f4a51489d62d2a6d0480a473c","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":5683653,"name":"drill","full_name":"apache/drill","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/drill","description":"Mirror of Apache Drill","fork":false,"url":"https://api.github.com/repos/apache/drill","forks_url":"https://api.github.com/repos/apache/drill/forks","keys_url":"https://api.github.com/repos/apache/drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/drill/teams","hooks_url":"https://api.github.com/repos/apache/drill/hooks","issue_events_url":"https://api.github.com/repos/apache/drill/issues/events{/number}","events_url":"https://api.github.com/repos/apache/drill/events","assignees_url":"https://api.github.com/repos/apache/drill/assignees{/user}","branches_url":"https://api.github.com/repos/apache/drill/branches{/branch}","tags_url":"https://api.github.com/repos/apache/drill/tags","blobs_url":"https://api.github.com/repos/apache/drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/drill/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/drill/languages","stargazers_url":"https://api.github.com/repos/apache/drill/stargazers","contributors_url":"https://api.github.com/repos/apache/drill/contributors","subscribers_url":"https://api.github.com/repos/apache/drill/subscribers","subscription_url":"https://api.github.com/repos/apache/drill/subscription","commits_url":"https://api.github.com/repos/apache/drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/drill/contents/{+path}","compare_url":"https://api.github.com/repos/apache/drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/drill/merges","archive_url":"https://api.github.com/repos/apache/drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/drill/downloads","issues_url":"https://api.github.com/repos/apache/drill/issues{/number}","pulls_url":"https://api.github.com/repos/apache/drill/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/drill/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/drill/labels{/name}","releases_url":"https://api.github.com/repos/apache/drill/releases{/id}","created_at":"2012-09-05T07:00:26Z","updated_at":"2015-11-02T10:37:56Z","pushed_at":"2015-11-03T03:17:58Z","git_url":"git://github.com/apache/drill.git","ssh_url":"git@github.com:apache/drill.git","clone_url":"https://github.com/apache/drill.git","svn_url":"https://github.com/apache/drill","homepage":"","size":49956,"stargazers_count":505,"watchers_count":505,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":330,"mirror_url":"git://git.apache.org/incubator-drill.git","open_issues_count":48,"forks":330,"open_issues":48,"watchers":505,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/189"},"html":{"href":"https://github.com/apache/drill/pull/189"},"issue":{"href":"https://api.github.com/repos/apache/drill/issues/189"},"comments":{"href":"https://api.github.com/repos/apache/drill/issues/189/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/drill/pulls/189/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/drill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/drill/pulls/189/commits"},"statuses":{"href":"https://api.github.com/repos/apache/drill/statuses/b335f704baf643ebbfa589162a686708a00a0fab"}}}}