{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5654","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5654/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5654/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5654/events","html_url":"https://github.com/cockroachdb/cockroach/pull/5654","id":144109570,"number":5654,"title":"sql: restore + complete support for non-aggregated aggregate funcs","user":{"login":"mjibson","id":41181,"avatar_url":"https://avatars.githubusercontent.com/u/41181?v=3","gravatar_id":"","url":"https://api.github.com/users/mjibson","html_url":"https://github.com/mjibson","followers_url":"https://api.github.com/users/mjibson/followers","following_url":"https://api.github.com/users/mjibson/following{/other_user}","gists_url":"https://api.github.com/users/mjibson/gists{/gist_id}","starred_url":"https://api.github.com/users/mjibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjibson/subscriptions","organizations_url":"https://api.github.com/users/mjibson/orgs","repos_url":"https://api.github.com/users/mjibson/repos","events_url":"https://api.github.com/users/mjibson/events{/privacy}","received_events_url":"https://api.github.com/users/mjibson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"nvanbenschoten","id":5438456,"avatar_url":"https://avatars.githubusercontent.com/u/5438456?v=3","gravatar_id":"","url":"https://api.github.com/users/nvanbenschoten","html_url":"https://github.com/nvanbenschoten","followers_url":"https://api.github.com/users/nvanbenschoten/followers","following_url":"https://api.github.com/users/nvanbenschoten/following{/other_user}","gists_url":"https://api.github.com/users/nvanbenschoten/gists{/gist_id}","starred_url":"https://api.github.com/users/nvanbenschoten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvanbenschoten/subscriptions","organizations_url":"https://api.github.com/users/nvanbenschoten/orgs","repos_url":"https://api.github.com/users/nvanbenschoten/repos","events_url":"https://api.github.com/users/nvanbenschoten/events{/privacy}","received_events_url":"https://api.github.com/users/nvanbenschoten/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-03-28T23:26:34Z","updated_at":"2016-03-29T19:07:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/5654","html_url":"https://github.com/cockroachdb/cockroach/pull/5654","diff_url":"https://github.com/cockroachdb/cockroach/pull/5654.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/5654.patch"},"body":"Aggregate functions, when called without column data, are invoked like\r\nnormal functions. That is, their `fn` property is executed. Aggregate funcs\r\ndon't include that property, so a panic was produced (for something like\r\n`SELECT AVG(1)`). Some of these used to function properly, but that was\r\nremoved (see listed revert commit).\r\n\r\nRestore that functionality and complete this support for the remainder of\r\nthe aggregate functions and types. Return values (including NULL) match\r\nthe behavior of postgres.\r\n\r\nAlso add decimal support to COUNT.\r\n\r\nPartially reverts commit a55f0548af82f6899ccf6fff96dd6509d41173fa.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/5654)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/203054205","html_url":"https://github.com/cockroachdb/cockroach/pull/5654#issuecomment-203054205","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5654","id":203054205,"user":{"login":"tamird","id":1535036,"avatar_url":"https://avatars.githubusercontent.com/u/1535036?v=3","gravatar_id":"","url":"https://api.github.com/users/tamird","html_url":"https://github.com/tamird","followers_url":"https://api.github.com/users/tamird/followers","following_url":"https://api.github.com/users/tamird/following{/other_user}","gists_url":"https://api.github.com/users/tamird/gists{/gist_id}","starred_url":"https://api.github.com/users/tamird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamird/subscriptions","organizations_url":"https://api.github.com/users/tamird/orgs","repos_url":"https://api.github.com/users/tamird/repos","events_url":"https://api.github.com/users/tamird/events{/privacy}","received_events_url":"https://api.github.com/users/tamird/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T19:07:11Z","updated_at":"2016-03-29T19:07:11Z","body":"\n\n\n\nReviewed 1 of 1 files at r2.\nReview status: all files reviewed at latest revision, 1 unresolved discussion.\n\n---\n\n\n\n*Comments from the [review on Reviewable.io](https://reviewable.io:443/reviews/cockroachdb/cockroach/5654)*\n<!-- Sent from Reviewable.io -->\n"}}