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

ClosureCleaner incorrectly warns for class based closures

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 2.4.0
    • Component/s: Spark Core
    • Labels:
      None

      Description

      Spark's `ClosureCleaner` utility seems to check whether a function is an anonymous function: ClosureCleaner.scala on line 49 If not, it warns the user.

      However, I'm using some class based functions. Something along the lines of:

      trait FromUnreadRow[T] extends (UnreadRow => T) with Serializable
      
      object ToPlainRow extends FromUnreadRow[PlainRow] {
        override def apply(row: UnreadRow): PlainRow = ???
      }
      

      This works just fine. I can't really see that the warning is actually useful in this case. I appreciate checking for common 'mistakes', but in my case a user might be alarmed unnecessarily.

      Anything that can be done about this? Anything I can do?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rekhajoshm Rekha Joshi
                Reporter:
                frensjan Frens Jan Rumph
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: