{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/23178","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/23178/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/23178/comments","events_url":"https://api.github.com/repos/apache/spark/issues/23178/events","html_url":"https://github.com/apache/spark/pull/23178","id":385747514,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0NjQ2Mzkw","number":23178,"title":"[SPARK-26216][SQL] Do not use case class as public API (UserDefinedFunction)","user":{"login":"cloud-fan","id":3182036,"node_id":"MDQ6VXNlcjMxODIwMzY=","avatar_url":"https://avatars3.githubusercontent.com/u/3182036?v=4","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,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-11-29T13:55:16Z","updated_at":"2018-11-29T19:11:27Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/23178","html_url":"https://github.com/apache/spark/pull/23178","diff_url":"https://github.com/apache/spark/pull/23178.diff","patch_url":"https://github.com/apache/spark/pull/23178.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nIt's a bad idea to use case class as public API, as it has a very wide surface. For example, the `copy` method, its fields, the companion object, etc.\r\n\r\nFor a particular case, `UserDefinedFunction`. It has a private constructor, and I believe we only want users to access a few methods:`apply`, `nullable`, `asNonNullable`, etc.\r\n\r\nHowever, all its fields, and `copy` method, and the companion object are public unexpectedly. As a result, we made many tricks to work around the binary compatibility issues.\r\n\r\nThis PR proposes to only make interfaces public, and hide implementations behind with a private class. Now `UserDefinedFunction` is a pure trait, and the concrete implementation is `SparkUserDefinedFunction`, which is private.\r\n\r\nChanging class to interface is not binary compatible(but source compatible), so 3.0 is a good chance to do it.\r\n\r\nThis is the first PR to go with this direction. If it's accepted, I'll create a umbrella JIRA and fix all the public case classes.\r\n\r\n## How was this patch tested?\r\n\r\nexisting tests.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/442956566","html_url":"https://github.com/apache/spark/pull/23178#issuecomment-442956566","issue_url":"https://api.github.com/repos/apache/spark/issues/23178","id":442956566,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Mjk1NjU2Ng==","user":{"login":"SparkQA","id":8108735,"node_id":"MDQ6VXNlcjgxMDg3MzU=","avatar_url":"https://avatars1.githubusercontent.com/u/8108735?v=4","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":"2018-11-29T19:11:27Z","updated_at":"2018-11-29T19:11:27Z","author_association":"NONE","body":"**[Test build #4448 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/4448/testReport)** for PR 23178 at commit [`69bc466`](https://github.com/apache/spark/commit/69bc466fc2047fc9912b0ebce3930c2cb57cacb1)."}}
{"actor":{"display_login":"SparkQA"}}