Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-45314 Drop Scala 2.12 and make Scala 2.13 by default
  3. SPARK-45699

Fix "Widening conversion from `TypeA` to `TypeB` is deprecated because it loses precision"

    XMLWordPrintableJSON

Details

    Description

      error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:1199:67: Widening conversion from Long to Double is deprecated because it loses precision. Write `.toDouble` instead. [quickfixable]
      [error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=deprecation, site=org.apache.spark.scheduler.TaskSetManager.checkSpeculatableTasks.threshold
      [error]       val threshold = max(speculationMultiplier * medianDuration, minTimeToSpeculation)
      [error]                                                                   ^
      [error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:1207:60: Widening conversion from Long to Double is deprecated because it loses precision. Write `.toDouble` instead. [quickfixable]
      [error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=deprecation, site=org.apache.spark.scheduler.TaskSetManager.checkSpeculatableTasks
      [error]       foundTasks = checkAndSubmitSpeculatableTasks(timeMs, threshold, customizedThreshold = true)
      [error]                                                            ^
      [error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowVectorReader.scala:137:48: Widening conversion from Int to Float is deprecated because it loses precision. Write `.toFloat` instead. [quickfixable]
      [error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=deprecation, site=org.apache.spark.sql.connect.client.arrow.IntVectorReader.getFloat
      [error]   override def getFloat(i: Int): Float = getInt(i)
      [error]                                                ^
      [error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowVectorReader.scala:146:49: Widening conversion from Long to Float is deprecated because it loses precision. Write `.toFloat` instead. [quickfixable]
      [error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=deprecation, site=org.apache.spark.sql.connect.client.arrow.BigIntVectorReader.getFloat
      [error]   override def getFloat(i: Int): Float = getLong(i)
      [error]                                                 ^
      [error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowVectorReader.scala:147:51: Widening conversion from Long to Double is deprecated because it loses precision. Write `.toDouble` instead. [quickfixable]
      [error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=deprecation, site=org.apache.spark.sql.connect.client.arrow.BigIntVectorReader.getDouble
      [error]   override def getDouble(i: Int): Double = getLong(i)
      [error]                                                   ^ 

       

       
      The example of the compilation warning is as above, there are probably over 100 similar cases that need to be fixed.
       
       

      Attachments

        Activity

          People

            hannahkamundson Hannah Amundson
            LuciferYang Yang Jie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: