{"action":"created","issue":{"url":"https://api.github.com/repos/typelevel/frameless/issues/110","repository_url":"https://api.github.com/repos/typelevel/frameless","labels_url":"https://api.github.com/repos/typelevel/frameless/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/typelevel/frameless/issues/110/comments","events_url":"https://api.github.com/repos/typelevel/frameless/issues/110/events","html_url":"https://github.com/typelevel/frameless/pull/110","id":208606425,"node_id":"MDExOlB1bGxSZXF1ZXN0MTA2ODQ1MDg5","number":110,"title":"Change TypeDataset#apply syntax to use a function","user":{"login":"jeremyrsmith","id":864869,"node_id":"MDQ6VXNlcjg2NDg2OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/864869?v=4","gravatar_id":"","url":"https://api.github.com/users/jeremyrsmith","html_url":"https://github.com/jeremyrsmith","followers_url":"https://api.github.com/users/jeremyrsmith/followers","following_url":"https://api.github.com/users/jeremyrsmith/following{/other_user}","gists_url":"https://api.github.com/users/jeremyrsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremyrsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremyrsmith/subscriptions","organizations_url":"https://api.github.com/users/jeremyrsmith/orgs","repos_url":"https://api.github.com/users/jeremyrsmith/repos","events_url":"https://api.github.com/users/jeremyrsmith/events{/privacy}","received_events_url":"https://api.github.com/users/jeremyrsmith/received_events","type":"User","site_admin":false},"labels":[{"id":606897036,"node_id":"MDU6TGFiZWw2MDY4OTcwMzY=","url":"https://api.github.com/repos/typelevel/frameless/labels/new%20feature","name":"new feature","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/typelevel/frameless/milestones/1","html_url":"https://github.com/typelevel/frameless/milestone/1","labels_url":"https://api.github.com/repos/typelevel/frameless/milestones/1/labels","id":2528645,"node_id":"MDk6TWlsZXN0b25lMjUyODY0NQ==","number":1,"title":"0.4-release","description":"","creator":{"login":"imarios","id":6893839,"node_id":"MDQ6VXNlcjY4OTM4Mzk=","avatar_url":"https://avatars0.githubusercontent.com/u/6893839?v=4","gravatar_id":"","url":"https://api.github.com/users/imarios","html_url":"https://github.com/imarios","followers_url":"https://api.github.com/users/imarios/followers","following_url":"https://api.github.com/users/imarios/following{/other_user}","gists_url":"https://api.github.com/users/imarios/gists{/gist_id}","starred_url":"https://api.github.com/users/imarios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imarios/subscriptions","organizations_url":"https://api.github.com/users/imarios/orgs","repos_url":"https://api.github.com/users/imarios/repos","events_url":"https://api.github.com/users/imarios/events{/privacy}","received_events_url":"https://api.github.com/users/imarios/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":2,"state":"closed","created_at":"2017-05-18T08:06:13Z","updated_at":"2018-01-30T19:39:40Z","due_on":null,"closed_at":"2018-01-30T19:39:40Z"},"comments":33,"created_at":"2017-02-18T02:53:40Z","updated_at":"2018-12-21T17:48:41Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/typelevel/frameless/pulls/110","html_url":"https://github.com/typelevel/frameless/pull/110","diff_url":"https://github.com/typelevel/frameless/pull/110.diff","patch_url":"https://github.com/typelevel/frameless/pull/110.patch"},"body":"Before/After:\r\n\r\n```scala\r\ncase class Foo(a: String, b: Int)\r\ncase class Bar(foo: Foo, c: Double)\r\n\r\nval ds = TypedDataset.create(spark.createDataset(Seq.empty[Bar]))\r\n\r\n// After:\r\nval a = ds.select(ds(_.foo.a))\r\nval b = ds.select(ds(_.foo.b))\r\nval c = ds.select(ds(_.c))\r\n\r\n// Before:\r\nval a = ??? // no equivalent\r\nval b = ??? // no equivalent\r\nval c = ds.select(ds('c))\r\n```\r\n\r\nI am proposing this change because:\r\n\r\n1. It typechecks before any macros are invoked\r\n2. It makes editors like IntelliJ happy (because of #1)\r\n3. It seems more idiomatic to me than using `Symbol`s\r\n4. It allows specifying columns of nested structures, which is impossible with the current syntax\r\n\r\nThe downside is that a macro is used. But, a macro is used (indirectly, through `Witness.apply`) for the existing syntax anyway. Also, that syntax uses implicit conversions, which the proposed syntax doesn't. The macro introduced for the new syntax is reasonably uncomplicated.\r\n\r\nI changed `apply` and left `col` intact, so that both syntaxes would be available. If this change is distasteful (understandable due to the BC break), it could be renamed to something other than `apply`. However, I really think this syntax is strictly more powerful than what's currently used for `apply`, and should be the default behavior."},"comment":{"url":"https://api.github.com/repos/typelevel/frameless/issues/comments/449453997","html_url":"https://github.com/typelevel/frameless/pull/110#issuecomment-449453997","issue_url":"https://api.github.com/repos/typelevel/frameless/issues/110","id":449453997,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTQ1Mzk5Nw==","user":{"login":"kujon","id":503380,"node_id":"MDQ6VXNlcjUwMzM4MA==","avatar_url":"https://avatars0.githubusercontent.com/u/503380?v=4","gravatar_id":"","url":"https://api.github.com/users/kujon","html_url":"https://github.com/kujon","followers_url":"https://api.github.com/users/kujon/followers","following_url":"https://api.github.com/users/kujon/following{/other_user}","gists_url":"https://api.github.com/users/kujon/gists{/gist_id}","starred_url":"https://api.github.com/users/kujon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kujon/subscriptions","organizations_url":"https://api.github.com/users/kujon/orgs","repos_url":"https://api.github.com/users/kujon/repos","events_url":"https://api.github.com/users/kujon/events{/privacy}","received_events_url":"https://api.github.com/users/kujon/received_events","type":"User","site_admin":false},"created_at":"2018-12-21T17:48:41Z","updated_at":"2018-12-21T17:48:41Z","author_association":"NONE","body":"Biiiiig 👍 for it working with IntelliJ!"}}
{"actor":{"display_login":"kujon"}}