{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/15076","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/15076/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/15076/comments","events_url":"https://api.github.com/repos/apache/spark/issues/15076/events","html_url":"https://github.com/apache/spark/pull/15076","id":176587741,"number":15076,"title":"[SPARK-17114][SQL] Fix aggregates grouped by literals with empty input.","user":{"login":"hvanhovell","id":9616802,"avatar_url":"https://avatars.githubusercontent.com/u/9616802?v=3","gravatar_id":"","url":"https://api.github.com/users/hvanhovell","html_url":"https://github.com/hvanhovell","followers_url":"https://api.github.com/users/hvanhovell/followers","following_url":"https://api.github.com/users/hvanhovell/following{/other_user}","gists_url":"https://api.github.com/users/hvanhovell/gists{/gist_id}","starred_url":"https://api.github.com/users/hvanhovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvanhovell/subscriptions","organizations_url":"https://api.github.com/users/hvanhovell/orgs","repos_url":"https://api.github.com/users/hvanhovell/repos","events_url":"https://api.github.com/users/hvanhovell/events{/privacy}","received_events_url":"https://api.github.com/users/hvanhovell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-13T09:05:21Z","updated_at":"2016-09-13T09:06:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/15076","html_url":"https://github.com/apache/spark/pull/15076","diff_url":"https://github.com/apache/spark/pull/15076.diff","patch_url":"https://github.com/apache/spark/pull/15076.patch"},"body":"## What changes were proposed in this pull request?\r\nThis PR fixes an issue with aggregates that have an empty input, and use a literals as their grouping keys. These aggregates are currently interpreted as aggregates **without** grouping keys, this triggers the ungrouped code path (which aways returns a single row).\r\n\r\nThis PR fixes this by adding a `isGrouped` flag to `Aggregate`. This flag is inferred when the `Aggregate` is created, but is kept when we change the `Aggregate`s grouping expressions. I have tried to implement this by wrapping the `groupingExpressions` in an `Option` but this is much more invasive and leads to much harder to use code.\r\n\r\n## How was this patch tested?\r\nAdded tests to `SQLQueryTestSuite`."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/246620862","html_url":"https://github.com/apache/spark/pull/15076#issuecomment-246620862","issue_url":"https://api.github.com/repos/apache/spark/issues/15076","id":246620862,"user":{"login":"hvanhovell","id":9616802,"avatar_url":"https://avatars.githubusercontent.com/u/9616802?v=3","gravatar_id":"","url":"https://api.github.com/users/hvanhovell","html_url":"https://github.com/hvanhovell","followers_url":"https://api.github.com/users/hvanhovell/followers","following_url":"https://api.github.com/users/hvanhovell/following{/other_user}","gists_url":"https://api.github.com/users/hvanhovell/gists{/gist_id}","starred_url":"https://api.github.com/users/hvanhovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvanhovell/subscriptions","organizations_url":"https://api.github.com/users/hvanhovell/orgs","repos_url":"https://api.github.com/users/hvanhovell/repos","events_url":"https://api.github.com/users/hvanhovell/events{/privacy}","received_events_url":"https://api.github.com/users/hvanhovell/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T09:06:00Z","updated_at":"2016-09-13T09:06:00Z","body":"cc @cloud-fan "}}
{"actor":{"display_login":"hvanhovell"}}