{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/13045","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/13045/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/13045/comments","events_url":"https://api.github.com/repos/apache/spark/issues/13045/events","html_url":"https://github.com/apache/spark/pull/13045","id":154167100,"number":13045,"title":"[SPARK-15114][SQL] Column name generated by typed aggregate is super verbose","user":{"login":"dilipbiswal","id":14225158,"avatar_url":"https://avatars.githubusercontent.com/u/14225158?v=3","gravatar_id":"","url":"https://api.github.com/users/dilipbiswal","html_url":"https://github.com/dilipbiswal","followers_url":"https://api.github.com/users/dilipbiswal/followers","following_url":"https://api.github.com/users/dilipbiswal/following{/other_user}","gists_url":"https://api.github.com/users/dilipbiswal/gists{/gist_id}","starred_url":"https://api.github.com/users/dilipbiswal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilipbiswal/subscriptions","organizations_url":"https://api.github.com/users/dilipbiswal/orgs","repos_url":"https://api.github.com/users/dilipbiswal/repos","events_url":"https://api.github.com/users/dilipbiswal/events{/privacy}","received_events_url":"https://api.github.com/users/dilipbiswal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-05-11T06:09:27Z","updated_at":"2016-05-11T12:36:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13045","html_url":"https://github.com/apache/spark/pull/13045","diff_url":"https://github.com/apache/spark/pull/13045.diff","patch_url":"https://github.com/apache/spark/pull/13045.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nGenerate a shorter default alias for `AggregateExpression `, In this PR, aggregate function name along with a index is used for generating the alias name.\r\n\r\n```SQL\r\nval ds = Seq(1, 3, 2, 5).toDS()\r\nds.select(typed.sum((i: Int) => i), typed.avg((i: Int) => i)).show()\r\n```\r\n\r\nOutput before change.\r\n```SQL\r\n+-----------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+\r\n|typedsumdouble(unresolveddeserializer(upcast(input[0, int], IntegerType, - root class: \"scala.Int\"), value#1), upcast(value))|typedaverage(unresolveddeserializer(upcast(input[0, int], IntegerType, - root class: \"scala.Int\"), value#1), newInstance(class scala.Tuple2))|\r\n+-----------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+\r\n|                                                                                                                         11.0|                                                                                                                                         2.75|\r\n+-----------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+\r\n```\r\nOutput after change:\r\n```SQL\r\n+-----------------+---------------+\r\n|typedsumdouble_c1|typedaverage_c2|\r\n+-----------------+---------------+\r\n|             11.0|           2.75|\r\n+-----------------+---------------+\r\n```\r\n\r\nNote: There is one test in ParquetSuites.scala which shows that that the system picked alias\r\nname is not usable and is rejected.  [test](https://github.com/apache/spark/blob/master/sql/hive/src/test/scala/org/apache/spark/sql/hive/parquetSuites.scala#L672-#L687)\r\n## How was this patch tested?\r\n\r\nA new test was added in DataSetAggregatorSuite. \r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/218446257","html_url":"https://github.com/apache/spark/pull/13045#issuecomment-218446257","issue_url":"https://api.github.com/repos/apache/spark/issues/13045","id":218446257,"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":"2016-05-11T12:36:15Z","updated_at":"2016-05-11T12:36:15Z","body":"Test FAILed.\nRefer to this link for build results (access rights to CI server needed): \nhttps://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58365/\nTest FAILed."}}