{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/9038","labels_url":"https://api.github.com/repos/apache/spark/issues/9038/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/9038/comments","events_url":"https://api.github.com/repos/apache/spark/issues/9038/events","html_url":"https://github.com/apache/spark/pull/9038","id":110558803,"number":9038,"title":"[SPARK-11017] [SQL] Support ImperativeAggregates in TungstenAggregate","user":{"login":"JoshRosen","id":50748,"avatar_url":"https://avatars.githubusercontent.com/u/50748?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshRosen","html_url":"https://github.com/JoshRosen","followers_url":"https://api.github.com/users/JoshRosen/followers","following_url":"https://api.github.com/users/JoshRosen/following{/other_user}","gists_url":"https://api.github.com/users/JoshRosen/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshRosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshRosen/subscriptions","organizations_url":"https://api.github.com/users/JoshRosen/orgs","repos_url":"https://api.github.com/users/JoshRosen/repos","events_url":"https://api.github.com/users/JoshRosen/events{/privacy}","received_events_url":"https://api.github.com/users/JoshRosen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-08T23:07:48Z","updated_at":"2015-10-10T04:22:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/9038","html_url":"https://github.com/apache/spark/pull/9038","diff_url":"https://github.com/apache/spark/pull/9038.diff","patch_url":"https://github.com/apache/spark/pull/9038.patch"},"body":"This patch extends TungstenAggregate to support ImperativeAggregate functions. The existing TungstenAggregate operator only supported DeclarativeAggregate functions, which are defined in terms of Catalyst expressions and can be evaluated via generated projections. ImperativeAggregate functions, on the other hand, are evaluated by calling their `initialize`, `update`, `merge`, and `eval` methods.\r\n\r\nThe basic strategy here is similar to how SortBasedAggregate evaluates both types of aggregate functions: use a generated projection to evaluate the expression-based declarative aggregates with dummy placeholder expressions inserted in place of the imperative aggregate function output, then invoke the imperative aggregate functions and target them against the aggregation buffer. The bulk of the diff here consists of code that was copied and adapted from SortBasedAggregate, with some key changes to handle TungstenAggregate's sort fallback path."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/147036458","html_url":"https://github.com/apache/spark/pull/9038#issuecomment-147036458","issue_url":"https://api.github.com/repos/apache/spark/issues/9038","id":147036458,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T04:22:20Z","updated_at":"2015-10-10T04:22:20Z","body":"Merged build started."}}