{"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/90745712","pull_request_review_id":11266767,"id":90745712,"diff_hunk":"@@ -0,0 +1,28 @@\n+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package com.facebook.presto.spi.function;\n+\n+import java.lang.annotation.Retention;\n+import java.lang.annotation.Target;\n+\n+import static java.lang.annotation.ElementType.METHOD;\n+import static java.lang.annotation.ElementType.PARAMETER;\n+import static java.lang.annotation.RetentionPolicy.RUNTIME;\n+\n+@Retention(RUNTIME)\n+@Target({METHOD, PARAMETER})\n+public @interface AggregationState","path":"presto-spi/src/main/java/com/facebook/presto/spi/function/AggregationState.java","position":25,"original_position":25,"commit_id":"7c809cb082f9f9f7e82f74f711e1158c68fc4f12","original_commit_id":"c8354b7ce32771c7334a344c1106203023b6a8be","user":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"body":"Could you add this to all the aggregations in presto-main? I think the backwards compatibility is useful, but we should changes the builtin functions so people have a good example to follow","created_at":"2016-12-03T01:10:40Z","updated_at":"2016-12-03T01:10:40Z","html_url":"https://github.com/prestodb/presto/pull/6627#discussion_r90745712","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/6627","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/90745712"},"html":{"href":"https://github.com/prestodb/presto/pull/6627#discussion_r90745712"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6627"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/6627","id":93774404,"html_url":"https://github.com/prestodb/presto/pull/6627","diff_url":"https://github.com/prestodb/presto/pull/6627.diff","patch_url":"https://github.com/prestodb/presto/pull/6627.patch","issue_url":"https://api.github.com/repos/prestodb/presto/issues/6627","number":6627,"state":"open","locked":false,"title":"Refactor in Annotation based functions","user":{"login":"fiedukow","id":297223,"avatar_url":"https://avatars.githubusercontent.com/u/297223?v=3","gravatar_id":"","url":"https://api.github.com/users/fiedukow","html_url":"https://github.com/fiedukow","followers_url":"https://api.github.com/users/fiedukow/followers","following_url":"https://api.github.com/users/fiedukow/following{/other_user}","gists_url":"https://api.github.com/users/fiedukow/gists{/gist_id}","starred_url":"https://api.github.com/users/fiedukow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiedukow/subscriptions","organizations_url":"https://api.github.com/users/fiedukow/orgs","repos_url":"https://api.github.com/users/fiedukow/repos","events_url":"https://api.github.com/users/fiedukow/events{/privacy}","received_events_url":"https://api.github.com/users/fiedukow/received_events","type":"User","site_admin":false},"body":"This refactor is continuation of https://github.com/prestodb/presto/pull/5381#issuecomment-228121580 based on comments collected there.\r\n\r\nThe main goals here are:\r\n * Allow all applicable annotation syntax from ParametricScalar to ParametricAggregates\r\n * Align two versions of parallel annotations engines where possible, extract whatever they have in common, to avoid desync of annotation syntax in future\r\n * Use newly created syntax to simplify existing aggregates implementations, namely MIN/MAX\r\n * Add tests to annotation engine\r\n\r\nThere was a macro benchmark performed to prove no drop in MIN/MAX performance after changes.\r\nFYI TD review: https://github.com/Teradata/presto/pull/396\r\n\r\nAssigning @cberner as the changes are made based on his requests.\r\n\r\nOut of scope TODO:\r\n * Separate parsing and validation code. Currently checking if functions are properly defined is mixed with parsing procedures. It would be much cleaner to separate that, especially as there are lots of checks there and we cannot even read those contracts easily.\r\n * @IsNull support in aggregates (+ extracting that to common Scalar/Aggregates code).\r\n * Support for constructor based injections in annotations\r\n * Support for specialized aggregates implementations\r\n\r\nCC: @cberner @ilfrin @losipiuk ","created_at":"2016-11-15T14:24:02Z","updated_at":"2016-12-03T01:13:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af6a34c24a4e0ae0a6317a317619a6cda392c8ef","assignee":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"assignees":[{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/6627/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/6627/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/6627/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/7c809cb082f9f9f7e82f74f711e1158c68fc4f12","head":{"label":"fiedukow:af/SWARM-3035/1","ref":"af/SWARM-3035/1","sha":"7c809cb082f9f9f7e82f74f711e1158c68fc4f12","user":{"login":"fiedukow","id":297223,"avatar_url":"https://avatars.githubusercontent.com/u/297223?v=3","gravatar_id":"","url":"https://api.github.com/users/fiedukow","html_url":"https://github.com/fiedukow","followers_url":"https://api.github.com/users/fiedukow/followers","following_url":"https://api.github.com/users/fiedukow/following{/other_user}","gists_url":"https://api.github.com/users/fiedukow/gists{/gist_id}","starred_url":"https://api.github.com/users/fiedukow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiedukow/subscriptions","organizations_url":"https://api.github.com/users/fiedukow/orgs","repos_url":"https://api.github.com/users/fiedukow/repos","events_url":"https://api.github.com/users/fiedukow/events{/privacy}","received_events_url":"https://api.github.com/users/fiedukow/received_events","type":"User","site_admin":false},"repo":{"id":55410684,"name":"presto","full_name":"fiedukow/presto","owner":{"login":"fiedukow","id":297223,"avatar_url":"https://avatars.githubusercontent.com/u/297223?v=3","gravatar_id":"","url":"https://api.github.com/users/fiedukow","html_url":"https://github.com/fiedukow","followers_url":"https://api.github.com/users/fiedukow/followers","following_url":"https://api.github.com/users/fiedukow/following{/other_user}","gists_url":"https://api.github.com/users/fiedukow/gists{/gist_id}","starred_url":"https://api.github.com/users/fiedukow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiedukow/subscriptions","organizations_url":"https://api.github.com/users/fiedukow/orgs","repos_url":"https://api.github.com/users/fiedukow/repos","events_url":"https://api.github.com/users/fiedukow/events{/privacy}","received_events_url":"https://api.github.com/users/fiedukow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fiedukow/presto","description":"Teradata's Certified Version of Presto -- A Distributed SQL Query Engine for Big Data","fork":true,"url":"https://api.github.com/repos/fiedukow/presto","forks_url":"https://api.github.com/repos/fiedukow/presto/forks","keys_url":"https://api.github.com/repos/fiedukow/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fiedukow/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fiedukow/presto/teams","hooks_url":"https://api.github.com/repos/fiedukow/presto/hooks","issue_events_url":"https://api.github.com/repos/fiedukow/presto/issues/events{/number}","events_url":"https://api.github.com/repos/fiedukow/presto/events","assignees_url":"https://api.github.com/repos/fiedukow/presto/assignees{/user}","branches_url":"https://api.github.com/repos/fiedukow/presto/branches{/branch}","tags_url":"https://api.github.com/repos/fiedukow/presto/tags","blobs_url":"https://api.github.com/repos/fiedukow/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fiedukow/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fiedukow/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/fiedukow/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fiedukow/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/fiedukow/presto/languages","stargazers_url":"https://api.github.com/repos/fiedukow/presto/stargazers","contributors_url":"https://api.github.com/repos/fiedukow/presto/contributors","subscribers_url":"https://api.github.com/repos/fiedukow/presto/subscribers","subscription_url":"https://api.github.com/repos/fiedukow/presto/subscription","commits_url":"https://api.github.com/repos/fiedukow/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/fiedukow/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/fiedukow/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/fiedukow/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/fiedukow/presto/contents/{+path}","compare_url":"https://api.github.com/repos/fiedukow/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fiedukow/presto/merges","archive_url":"https://api.github.com/repos/fiedukow/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fiedukow/presto/downloads","issues_url":"https://api.github.com/repos/fiedukow/presto/issues{/number}","pulls_url":"https://api.github.com/repos/fiedukow/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/fiedukow/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/fiedukow/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fiedukow/presto/labels{/name}","releases_url":"https://api.github.com/repos/fiedukow/presto/releases{/id}","deployments_url":"https://api.github.com/repos/fiedukow/presto/deployments","created_at":"2016-04-04T12:49:39Z","updated_at":"2016-04-04T12:49:50Z","pushed_at":"2016-12-01T18:45:17Z","git_url":"git://github.com/fiedukow/presto.git","ssh_url":"git@github.com:fiedukow/presto.git","clone_url":"https://github.com/fiedukow/presto.git","svn_url":"https://github.com/fiedukow/presto","homepage":"http://www.teradata.com/presto","size":105935,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"prestodb:master","ref":"master","sha":"ebdc8ced4ca3ca86e7c0b06af3105fa70ccf453a","user":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","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,"name":"presto","full_name":"prestodb/presto","owner":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","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},"private":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":"2016-12-02T21:25:33Z","pushed_at":"2016-12-03T01:12:45Z","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":"https://prestodb.io","size":172955,"stargazers_count":5356,"watchers_count":5356,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1676,"mirror_url":null,"open_issues_count":782,"forks":1676,"open_issues":782,"watchers":5356,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6627"},"html":{"href":"https://github.com/prestodb/presto/pull/6627"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/6627"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/6627/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6627/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6627/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/7c809cb082f9f9f7e82f74f711e1158c68fc4f12"}}}}
{"actor":{"display_login":"cberner"}}