{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/3910","labels_url":"https://api.github.com/repos/apache/spark/issues/3910/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/3910/comments","events_url":"https://api.github.com/repos/apache/spark/issues/3910/events","html_url":"https://github.com/apache/spark/pull/3910","id":53513855,"number":3910,"title":"[SPARK-4296][SQL] Trims aliases when resolving and checking aggregate expressions","user":{"login":"liancheng","id":230655,"avatar_url":"https://avatars.githubusercontent.com/u/230655?v=3","gravatar_id":"","url":"https://api.github.com/users/liancheng","html_url":"https://github.com/liancheng","followers_url":"https://api.github.com/users/liancheng/followers","following_url":"https://api.github.com/users/liancheng/following{/other_user}","gists_url":"https://api.github.com/users/liancheng/gists{/gist_id}","starred_url":"https://api.github.com/users/liancheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liancheng/subscriptions","organizations_url":"https://api.github.com/users/liancheng/orgs","repos_url":"https://api.github.com/users/liancheng/repos","events_url":"https://api.github.com/users/liancheng/events{/privacy}","received_events_url":"https://api.github.com/users/liancheng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-06T13:19:44Z","updated_at":"2015-01-07T00:54:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/3910","html_url":"https://github.com/apache/spark/pull/3910","diff_url":"https://github.com/apache/spark/pull/3910.diff","patch_url":"https://github.com/apache/spark/pull/3910.patch"},"body":"This PR is a follow-up of PR #3248.  We should not only trim `Alias` around `GetField` but also all unnamed expressions when resolving and checking aggregate expressions. Trimming all aliases is safe because `GROUP BY` doesn't allow aliasing, thus all aliases added to an aggregate expression which is also a grouping expression must be introduced while resolving unnamed expressions like `GetField` and UDF calls.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/apache/spark/3910)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/68962335","html_url":"https://github.com/apache/spark/pull/3910#issuecomment-68962335","issue_url":"https://api.github.com/repos/apache/spark/issues/3910","id":68962335,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T00:54:57Z","updated_at":"2015-01-07T00:54:57Z","body":"  [Test build #25123 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25123/consoleFull) for   PR 3910 at commit [`807e13e`](https://github.com/apache/spark/commit/807e13e8f8f855ca3891635a4b82b80afd369459).\n * This patch **fails Spark unit tests**.\n * This patch merges cleanly.\n * This patch adds the following public classes _(experimental)_:\n  * `              SparkSubmit.printErrorAndExit(s\"Cannot load main class from JAR $primaryResource\")`\n  * `class BinaryClassificationMetrics(`\n"}}