{"action":"created","issue":{"url":"https://api.github.com/repos/adelbertc/frameless/issues/18","repository_url":"https://api.github.com/repos/adelbertc/frameless","labels_url":"https://api.github.com/repos/adelbertc/frameless/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/adelbertc/frameless/issues/18/comments","events_url":"https://api.github.com/repos/adelbertc/frameless/issues/18/events","html_url":"https://github.com/adelbertc/frameless/pull/18","id":140394169,"number":18,"title":"Types for aggregate expressions","user":{"login":"kanterov","id":467927,"avatar_url":"https://avatars.githubusercontent.com/u/467927?v=3","gravatar_id":"","url":"https://api.github.com/users/kanterov","html_url":"https://github.com/kanterov","followers_url":"https://api.github.com/users/kanterov/followers","following_url":"https://api.github.com/users/kanterov/following{/other_user}","gists_url":"https://api.github.com/users/kanterov/gists{/gist_id}","starred_url":"https://api.github.com/users/kanterov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanterov/subscriptions","organizations_url":"https://api.github.com/users/kanterov/orgs","repos_url":"https://api.github.com/users/kanterov/repos","events_url":"https://api.github.com/users/kanterov/events{/privacy}","received_events_url":"https://api.github.com/users/kanterov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-03-12T15:44:53Z","updated_at":"2016-05-09T10:47:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/adelbertc/frameless/pulls/18","html_url":"https://github.com/adelbertc/frameless/pull/18","diff_url":"https://github.com/adelbertc/frameless/pull/18.diff","patch_url":"https://github.com/adelbertc/frameless/pull/18.patch"},"body":"This pull request adds better types for aggregate expressions. \r\n\r\nIt turned out that aggregate expressions give different result types if they are used in context of `select(...)` and `groupBy(...).agg(...)`. Let's consider an example:\r\n\r\n```scala\r\ncase class Invoice(date: LocalDate, amount: Int)\r\n\r\nval tf: TypedDataset[Invoice]\r\nval sum: TypedDataset[Option[Int]] = tf.select(sum(tf.col('amount)))\r\nval sumPerDate: TypedDataset[(LocalDate, Int)] = tf.groupBy(tf.col('date)).agg(sum(tf.col('amount)))\r\n```\r\n\r\nPreviously, type of `sumPerDate` was `TypedDataset[(LocalDate, Option[Int])]`."},"comment":{"url":"https://api.github.com/repos/adelbertc/frameless/issues/comments/217833341","html_url":"https://github.com/adelbertc/frameless/pull/18#issuecomment-217833341","issue_url":"https://api.github.com/repos/adelbertc/frameless/issues/18","id":217833341,"user":{"login":"kanterov","id":467927,"avatar_url":"https://avatars.githubusercontent.com/u/467927?v=3","gravatar_id":"","url":"https://api.github.com/users/kanterov","html_url":"https://github.com/kanterov","followers_url":"https://api.github.com/users/kanterov/followers","following_url":"https://api.github.com/users/kanterov/following{/other_user}","gists_url":"https://api.github.com/users/kanterov/gists{/gist_id}","starred_url":"https://api.github.com/users/kanterov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanterov/subscriptions","organizations_url":"https://api.github.com/users/kanterov/orgs","repos_url":"https://api.github.com/users/kanterov/repos","events_url":"https://api.github.com/users/kanterov/events{/privacy}","received_events_url":"https://api.github.com/users/kanterov/received_events","type":"User","site_admin":false},"created_at":"2016-05-09T10:47:47Z","updated_at":"2016-05-09T10:47:47Z","body":"@OlivierBlanvillain I've updated PR, please take a look. \r\n\r\nI've tried to use the SI-2712 fix, it worked, but compile time has increased by 25%, that is almost a minute, that's why I didn't include this change."}}