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

compare of -0.0 < 0.0 return true

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 3.0.1
    • Fix Version/s: 3.0.2, 3.1.0
    • Component/s: SQL
    • Labels:
    • Target Version/s:

      Description

       val spark: SparkSession = SparkSession
            .builder()
            .master("local")
            .appName("SparkByExamples.com")
            .getOrCreate()
          spark.sparkContext.setLogLevel("ERROR")
      
          import spark.sqlContext.implicits._
      
          val df = Seq((-0.0, 0.0)).toDF("neg", "pos")
            .withColumn("comp", col("neg") < col("pos"))
            df.show(false)
      
      ======
      
      +----+---+----+
      |neg |pos|comp|
      +----+---+----+
      |-0.0|0.0|true|
      +----+---+----+

      I think that result should be false.

      *Apache Spark 2.4.6 RESULT*

      scala> spark.version
      res0: String = 2.4.6
      
      scala> Seq((-0.0, 0.0)).toDF("neg", "pos").withColumn("comp", col("neg") < col("pos")).show
      +----+---+-----+
      | neg|pos| comp|
      +----+---+-----+
      |-0.0|0.0|false|
      +----+---+-----+
      

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              cloud_fan Wenchen Fan
              Reporter:
              igreenfi Izek Greenfield

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment