{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/13269","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/13269/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/13269/comments","events_url":"https://api.github.com/repos/apache/spark/issues/13269/events","html_url":"https://github.com/apache/spark/pull/13269","id":156393090,"number":13269,"title":"[SPARK-15494][SQL] encoder code cleanup","user":{"login":"cloud-fan","id":3182036,"avatar_url":"https://avatars.githubusercontent.com/u/3182036?v=3","gravatar_id":"","url":"https://api.github.com/users/cloud-fan","html_url":"https://github.com/cloud-fan","followers_url":"https://api.github.com/users/cloud-fan/followers","following_url":"https://api.github.com/users/cloud-fan/following{/other_user}","gists_url":"https://api.github.com/users/cloud-fan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloud-fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloud-fan/subscriptions","organizations_url":"https://api.github.com/users/cloud-fan/orgs","repos_url":"https://api.github.com/users/cloud-fan/repos","events_url":"https://api.github.com/users/cloud-fan/events{/privacy}","received_events_url":"https://api.github.com/users/cloud-fan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-05-24T00:06:50Z","updated_at":"2016-06-03T02:47:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13269","html_url":"https://github.com/apache/spark/pull/13269","diff_url":"https://github.com/apache/spark/pull/13269.diff","patch_url":"https://github.com/apache/spark/pull/13269.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nOur encoder framework has been evolved a lot, this PR tries to clean up the code to make it more readable and emphasise the concept that encoder should be used as a container of serde expressions.\r\n\r\n1. move validation logic to analyzer instead of encoder\r\n2. only have a `resolveAndBind` method in encoder instead of `resolve` and `bind`, as we don't have the encoder life cycle concept anymore.\r\n3. `Dataset` don't need to keep a resolved encoder, as there is no such concept anymore. bound encoder is still needed to do serialization outside of query framework.\r\n4. Using `BoundReference` to represent an unresolved field in deserializer expression is kind of weird, this PR adds a `GetColumnByOrdinal` for this purpose. (serializer expression still use `BoundReference`, we can replace it with `GetColumnByOrdinal` in follow-ups)\r\n\r\n\r\n## How was this patch tested?\r\n\r\nexisting test\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/223478031","html_url":"https://github.com/apache/spark/pull/13269#issuecomment-223478031","issue_url":"https://api.github.com/repos/apache/spark/issues/13269","id":223478031,"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-06-03T02:47:33Z","updated_at":"2016-06-03T02:47:33Z","body":"Merged build finished. Test PASSed."}}
{"actor":{"display_login":"AmplabJenkins"}}