Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-26244

Do not use case class as public API

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Done
    • 3.0.0
    • None
    • Spark Core, SQL

    Description

      It'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.

      I don't think it's expect to expose so many stuff to end users, and usually we only want to expose a few methods.

      We should use a pure trait as public API, and use case class as an implementation, which should be private and hide from end users.

      Changing class to interface is not binary compatible(but source compatible), so 3.0 is a good chance to do it.

      Attachments

        There are no Sub-Tasks for this issue.

        Activity

          People

            Unassigned Unassigned
            cloud_fan Wenchen Fan
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: