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

Public Row no longer overrides hashCode / violates hashCode + equals contract

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.5.0
    • 1.5.0
    • SQL
    • None

    Description

      It appears that the public Row's hashCode is no longer overridden as of Spark 1.5.0:

      val x = Row("Hello")
      val y = Row("Hello")
      println(x == y)
      println(x.hashCode)
      println(y.hashCode)
      

      outputs

      true
      1032103993
      1346393532
      

      This violates the hashCode/equals contract.

      I discovered this because it broke tests in the spark-avro library.

      Attachments

        Activity

          People

            joshrosen Josh Rosen
            joshrosen Josh Rosen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: