payload: {"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/262213859","pull_request_review_id":210305679,"id":262213859,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2MjIxMzg1OQ==","diff_hunk":"@@ -164,20 +165,20 @@ public PlanNode visitAggregation(AggregationNode node, RewriteContext<Optional<A\n                                     functionCall.getWindow(),\n                                     false,\n                                     ImmutableList.of(aggregateInfo.getNewDistinctAggregateSymbol().toSymbolReference())),\n-                            entry.getValue().getSignature(),\n+                            entry.getValue().getFunctionHandle(),\n                             Optional.empty()));\n                 }\n                 else {\n                     // Aggregations on non-distinct are already done by new node, just extract the non-null value\n                     Symbol argument = aggregateInfo.getNewNonDistinctAggregateSymbols().get(entry.getKey());\n-                    QualifiedName functionName = QualifiedName.of(\"arbitrary\");\n-                    String signatureName = entry.getValue().getSignature().getName();\n+                    QualifiedName arbitraryFunctionName = QualifiedName.of(\"arbitrary\");\n                     Aggregation aggregation = new Aggregation(\n-                            new FunctionCall(functionName, functionCall.getWindow(), false, ImmutableList.of(argument.toSymbolReference())),\n-                            getFunctionSignature(functionName, argument),\n+                            new FunctionCall(arbitraryFunctionName, functionCall.getWindow(), false, ImmutableList.of(argument.toSymbolReference())),\n+                            metadata.getFunctionManager().resolveFunction(session, arbitraryFunctionName, ImmutableList.of(new TypeSignatureProvider(symbolAllocator.getTypes().get(argument).getTypeSignature()))),\n                             Optional.empty());\n-                    if (signatureName.equals(\"count\")\n-                            || signatureName.equals(\"count_if\") || signatureName.equals(\"approx_distinct\")) {\n+                    String functionName = functionCall.getName().getSuffix();\n+                    if (functionName.equals(\"count\")","path":"presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/OptimizeMixedDistinctAggregations.java","position":56,"original_position":56,"commit_id":"47ca13b15f64fad12d7150c87d20a8fbf7e97702","original_commit_id":"47ca13b15f64fad12d7150c87d20a8fbf7e97702","user":{"login":"highker","id":2192913,"node_id":"MDQ6VXNlcjIxOTI5MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/2192913?v=4","gravatar_id":"","url":"https://api.github.com/users/highker","html_url":"https://github.com/highker","followers_url":"https://api.github.com/users/highker/followers","following_url":"https://api.github.com/users/highker/following{/other_user}","gists_url":"https://api.github.com/users/highker/gists{/gist_id}","starred_url":"https://api.github.com/users/highker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highker/subscriptions","organizations_url":"https://api.github.com/users/highker/orgs","repos_url":"https://api.github.com/users/highker/repos","events_url":"https://api.github.com/users/highker/events{/privacy}","received_events_url":"https://api.github.com/users/highker/received_events","type":"User","site_admin":false},"body":"Even the original statement is with two line; but we can squeeze them into one in this case:\r\n```\r\nif (functionName.equals(\"count\") || functionName.equals(\"count_if\") || functionName.equals(\"approx_distinct\")) {`\r\n```","created_at":"2019-03-04T19:44:08Z","updated_at":"2019-03-04T19:57:49Z","html_url":"https://github.com/prestodb/presto/pull/12427#discussion_r262213859","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/12427","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/262213859"},"html":{"href":"https://github.com/prestodb/presto/pull/12427#discussion_r262213859"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/12427"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/12427","id":258049527,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU4MDQ5NTI3","html_url":"https://github.com/prestodb/presto/pull/12427","diff_url":"https://github.com/prestodb/presto/pull/12427.diff","patch_url":"https://github.com/prestodb/presto/pull/12427.patch","issue_url":"https://api.github.com/repos/prestodb/presto/issues/12427","number":12427,"state":"open","locked":false,"title":"Add FunctionHandle as abstraction for function resolution","user":{"login":"rongrong","id":1448363,"node_id":"MDQ6VXNlcjE0NDgzNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/1448363?v=4","gravatar_id":"","url":"https://api.github.com/users/rongrong","html_url":"https://github.com/rongrong","followers_url":"https://api.github.com/users/rongrong/followers","following_url":"https://api.github.com/users/rongrong/following{/other_user}","gists_url":"https://api.github.com/users/rongrong/gists{/gist_id}","starred_url":"https://api.github.com/users/rongrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rongrong/subscriptions","organizations_url":"https://api.github.com/users/rongrong/orgs","repos_url":"https://api.github.com/users/rongrong/repos","events_url":"https://api.github.com/users/rongrong/events{/privacy}","received_events_url":"https://api.github.com/users/rongrong/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-03-04T18:45:38Z","updated_at":"2019-03-04T19:57:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"01c2a43f59102456acbbd98b0a818dc66100a4f2","assignee":{"login":"highker","id":2192913,"node_id":"MDQ6VXNlcjIxOTI5MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/2192913?v=4","gravatar_id":"","url":"https://api.github.com/users/highker","html_url":"https://github.com/highker","followers_url":"https://api.github.com/users/highker/followers","following_url":"https://api.github.com/users/highker/following{/other_user}","gists_url":"https://api.github.com/users/highker/gists{/gist_id}","starred_url":"https://api.github.com/users/highker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highker/subscriptions","organizations_url":"https://api.github.com/users/highker/orgs","repos_url":"https://api.github.com/users/highker/repos","events_url":"https://api.github.com/users/highker/events{/privacy}","received_events_url":"https://api.github.com/users/highker/received_events","type":"User","site_admin":false},"assignees":[{"login":"highker","id":2192913,"node_id":"MDQ6VXNlcjIxOTI5MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/2192913?v=4","gravatar_id":"","url":"https://api.github.com/users/highker","html_url":"https://github.com/highker","followers_url":"https://api.github.com/users/highker/followers","following_url":"https://api.github.com/users/highker/following{/other_user}","gists_url":"https://api.github.com/users/highker/gists{/gist_id}","starred_url":"https://api.github.com/users/highker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highker/subscriptions","organizations_url":"https://api.github.com/users/highker/orgs","repos_url":"https://api.github.com/users/highker/repos","events_url":"https://api.github.com/users/highker/events{/privacy}","received_events_url":"https://api.github.com/users/highker/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"hellium01","id":4419959,"node_id":"MDQ6VXNlcjQ0MTk5NTk=","avatar_url":"https://avatars2.githubusercontent.com/u/4419959?v=4","gravatar_id":"","url":"https://api.github.com/users/hellium01","html_url":"https://github.com/hellium01","followers_url":"https://api.github.com/users/hellium01/followers","following_url":"https://api.github.com/users/hellium01/following{/other_user}","gists_url":"https://api.github.com/users/hellium01/gists{/gist_id}","starred_url":"https://api.github.com/users/hellium01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellium01/subscriptions","organizations_url":"https://api.github.com/users/hellium01/orgs","repos_url":"https://api.github.com/users/hellium01/repos","events_url":"https://api.github.com/users/hellium01/events{/privacy}","received_events_url":"https://api.github.com/users/hellium01/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":196992743,"node_id":"MDU6TGFiZWwxOTY5OTI3NDM=","url":"https://api.github.com/repos/prestodb/presto/labels/CLA%20Signed","name":"CLA Signed","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/12427/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/12427/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/12427/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/47ca13b15f64fad12d7150c87d20a8fbf7e97702","head":{"label":"rongrong:function-handle-review","ref":"function-handle-review","sha":"47ca13b15f64fad12d7150c87d20a8fbf7e97702","user":{"login":"rongrong","id":1448363,"node_id":"MDQ6VXNlcjE0NDgzNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/1448363?v=4","gravatar_id":"","url":"https://api.github.com/users/rongrong","html_url":"https://github.com/rongrong","followers_url":"https://api.github.com/users/rongrong/followers","following_url":"https://api.github.com/users/rongrong/following{/other_user}","gists_url":"https://api.github.com/users/rongrong/gists{/gist_id}","starred_url":"https://api.github.com/users/rongrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rongrong/subscriptions","organizations_url":"https://api.github.com/users/rongrong/orgs","repos_url":"https://api.github.com/users/rongrong/repos","events_url":"https://api.github.com/users/rongrong/events{/privacy}","received_events_url":"https://api.github.com/users/rongrong/received_events","type":"User","site_admin":false},"repo":{"id":71846456,"node_id":"MDEwOlJlcG9zaXRvcnk3MTg0NjQ1Ng==","name":"presto","full_name":"rongrong/presto","private":false,"owner":{"login":"rongrong","id":1448363,"node_id":"MDQ6VXNlcjE0NDgzNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/1448363?v=4","gravatar_id":"","url":"https://api.github.com/users/rongrong","html_url":"https://github.com/rongrong","followers_url":"https://api.github.com/users/rongrong/followers","following_url":"https://api.github.com/users/rongrong/following{/other_user}","gists_url":"https://api.github.com/users/rongrong/gists{/gist_id}","starred_url":"https://api.github.com/users/rongrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rongrong/subscriptions","organizations_url":"https://api.github.com/users/rongrong/orgs","repos_url":"https://api.github.com/users/rongrong/repos","events_url":"https://api.github.com/users/rongrong/events{/privacy}","received_events_url":"https://api.github.com/users/rongrong/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rongrong/presto","description":"Distributed SQL query engine for big data","fork":true,"url":"https://api.github.com/repos/rongrong/presto","forks_url":"https://api.github.com/repos/rongrong/presto/forks","keys_url":"https://api.github.com/repos/rongrong/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rongrong/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rongrong/presto/teams","hooks_url":"https://api.github.com/repos/rongrong/presto/hooks","issue_events_url":"https://api.github.com/repos/rongrong/presto/issues/events{/number}","events_url":"https://api.github.com/repos/rongrong/presto/events","assignees_url":"https://api.github.com/repos/rongrong/presto/assignees{/user}","branches_url":"https://api.github.com/repos/rongrong/presto/branches{/branch}","tags_url":"https://api.github.com/repos/rongrong/presto/tags","blobs_url":"https://api.github.com/repos/rongrong/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rongrong/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rongrong/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/rongrong/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rongrong/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/rongrong/presto/languages","stargazers_url":"https://api.github.com/repos/rongrong/presto/stargazers","contributors_url":"https://api.github.com/repos/rongrong/presto/contributors","subscribers_url":"https://api.github.com/repos/rongrong/presto/subscribers","subscription_url":"https://api.github.com/repos/rongrong/presto/subscription","commits_url":"https://api.github.com/repos/rongrong/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/rongrong/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/rongrong/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/rongrong/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/rongrong/presto/contents/{+path}","compare_url":"https://api.github.com/repos/rongrong/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rongrong/presto/merges","archive_url":"https://api.github.com/repos/rongrong/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rongrong/presto/downloads","issues_url":"https://api.github.com/repos/rongrong/presto/issues{/number}","pulls_url":"https://api.github.com/repos/rongrong/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/rongrong/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/rongrong/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rongrong/presto/labels{/name}","releases_url":"https://api.github.com/repos/rongrong/presto/releases{/id}","deployments_url":"https://api.github.com/repos/rongrong/presto/deployments","created_at":"2016-10-25T01:12:51Z","updated_at":"2019-02-26T23:50:43Z","pushed_at":"2019-03-04T18:44:43Z","git_url":"git://github.com/rongrong/presto.git","ssh_url":"git@github.com:rongrong/presto.git","clone_url":"https://github.com/rongrong/presto.git","svn_url":"https://github.com/rongrong/presto","homepage":"https://prestodb.io","size":107388,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prestodb:master","ref":"master","sha":"75473c1ad7f996a8eebfcc46edc3e3ac811603d2","user":{"login":"prestodb","id":6882181,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4ODIxODE=","avatar_url":"https://avatars0.githubusercontent.com/u/6882181?v=4","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"node_id":"MDEwOlJlcG9zaXRvcnk1MzQ5NTY1","name":"presto","full_name":"prestodb/presto","private":false,"owner":{"login":"prestodb","id":6882181,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4ODIxODE=","avatar_url":"https://avatars0.githubusercontent.com/u/6882181?v=4","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/prestodb/presto","description":"Distributed SQL query engine for big data","fork":false,"url":"https://api.github.com/repos/prestodb/presto","forks_url":"https://api.github.com/repos/prestodb/presto/forks","keys_url":"https://api.github.com/repos/prestodb/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestodb/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestodb/presto/teams","hooks_url":"https://api.github.com/repos/prestodb/presto/hooks","issue_events_url":"https://api.github.com/repos/prestodb/presto/issues/events{/number}","events_url":"https://api.github.com/repos/prestodb/presto/events","assignees_url":"https://api.github.com/repos/prestodb/presto/assignees{/user}","branches_url":"https://api.github.com/repos/prestodb/presto/branches{/branch}","tags_url":"https://api.github.com/repos/prestodb/presto/tags","blobs_url":"https://api.github.com/repos/prestodb/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestodb/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestodb/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestodb/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/prestodb/presto/languages","stargazers_url":"https://api.github.com/repos/prestodb/presto/stargazers","contributors_url":"https://api.github.com/repos/prestodb/presto/contributors","subscribers_url":"https://api.github.com/repos/prestodb/presto/subscribers","subscription_url":"https://api.github.com/repos/prestodb/presto/subscription","commits_url":"https://api.github.com/repos/prestodb/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestodb/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestodb/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestodb/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestodb/presto/contents/{+path}","compare_url":"https://api.github.com/repos/prestodb/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestodb/presto/merges","archive_url":"https://api.github.com/repos/prestodb/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestodb/presto/downloads","issues_url":"https://api.github.com/repos/prestodb/presto/issues{/number}","pulls_url":"https://api.github.com/repos/prestodb/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/prestodb/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/prestodb/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestodb/presto/labels{/name}","releases_url":"https://api.github.com/repos/prestodb/presto/releases{/id}","deployments_url":"https://api.github.com/repos/prestodb/presto/deployments","created_at":"2012-08-09T01:03:37Z","updated_at":"2019-03-04T18:27:55Z","pushed_at":"2019-03-04T19:26:34Z","git_url":"git://github.com/prestodb/presto.git","ssh_url":"git@github.com:prestodb/presto.git","clone_url":"https://github.com/prestodb/presto.git","svn_url":"https://github.com/prestodb/presto","homepage":"http://prestodb.github.io","size":107644,"stargazers_count":8778,"watchers_count":8778,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2982,"mirror_url":null,"archived":false,"open_issues_count":1425,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2982,"open_issues":1425,"watchers":8778,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/12427"},"html":{"href":"https://github.com/prestodb/presto/pull/12427"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/12427"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/12427/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/12427/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/12427/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/47ca13b15f64fad12d7150c87d20a8fbf7e97702"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"highker"}}