{"action":"created","issue":{"url":"https://api.github.com/repos/druid-io/druid/issues/1965","labels_url":"https://api.github.com/repos/druid-io/druid/issues/1965/labels{/name}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/1965/comments","events_url":"https://api.github.com/repos/druid-io/druid/issues/1965/events","html_url":"https://github.com/druid-io/druid/pull/1965","id":116704279,"number":1965,"title":"discuss - support variance and standard deviation","user":{"login":"himanshug","id":246308,"avatar_url":"https://avatars.githubusercontent.com/u/246308?v=3","gravatar_id":"","url":"https://api.github.com/users/himanshug","html_url":"https://github.com/himanshug","followers_url":"https://api.github.com/users/himanshug/followers","following_url":"https://api.github.com/users/himanshug/following{/other_user}","gists_url":"https://api.github.com/users/himanshug/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshug/subscriptions","organizations_url":"https://api.github.com/users/himanshug/orgs","repos_url":"https://api.github.com/users/himanshug/repos","events_url":"https://api.github.com/users/himanshug/events{/privacy}","received_events_url":"https://api.github.com/users/himanshug/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/druid-io/druid/labels/Discuss","name":"Discuss","color":"ff00ff"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-13T05:44:20Z","updated_at":"2015-11-13T19:10:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/1965","html_url":"https://github.com/druid-io/druid/pull/1965","diff_url":"https://github.com/druid-io/druid/pull/1965.diff","patch_url":"https://github.com/druid-io/druid/pull/1965.patch"},"body":"this PR attempts to add optional field \"exponent\" to longSum and doubleSum aggregators to allow storing\r\nsum(x^k) and not just sum(x)\r\nalso, support for computing square root is added to arithmetic post aggregator.\r\n\r\nnow, say, you want to report standard deviation on a metric x. you would need to store 3 columns\r\nsum of x, sum of square of x and count\r\n\r\nat query time, it should be possible to compute standard deviation by using the formula..\r\n\r\nhttps://upload.wikimedia.org/math/a/9/0/a9072b8b9fb3c99c2a0a715e5c94da3b.png\r\n\r\nit would be variance if you didn't do square root \r\n\r\nin general, by just using long/double sum , users can possibly compute a variety of statistics functions."},"comment":{"url":"https://api.github.com/repos/druid-io/druid/issues/comments/156529179","html_url":"https://github.com/druid-io/druid/pull/1965#issuecomment-156529179","issue_url":"https://api.github.com/repos/druid-io/druid/issues/1965","id":156529179,"user":{"login":"nishantmonu51","id":5023786,"avatar_url":"https://avatars.githubusercontent.com/u/5023786?v=3","gravatar_id":"","url":"https://api.github.com/users/nishantmonu51","html_url":"https://github.com/nishantmonu51","followers_url":"https://api.github.com/users/nishantmonu51/followers","following_url":"https://api.github.com/users/nishantmonu51/following{/other_user}","gists_url":"https://api.github.com/users/nishantmonu51/gists{/gist_id}","starred_url":"https://api.github.com/users/nishantmonu51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nishantmonu51/subscriptions","organizations_url":"https://api.github.com/users/nishantmonu51/orgs","repos_url":"https://api.github.com/users/nishantmonu51/repos","events_url":"https://api.github.com/users/nishantmonu51/events{/privacy}","received_events_url":"https://api.github.com/users/nishantmonu51/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T19:10:01Z","updated_at":"2015-11-13T19:10:01Z","body":"+1 on having composing aggregators at the query level to do this and the implementation can can optimize things based on the compositions.  "}}