srowen commented on code in PR #43456:
URL: https://github.com/apache/spark/pull/43456#discussion_r1373180796


##########
sql/api/src/main/scala/org/apache/spark/sql/types/FloatType.scala:
##########
@@ -41,37 +39,4 @@ class FloatType private() extends FractionalType {
  * @since 1.3.0
  */
 @Stable
-case object FloatType extends FloatType {
-
-  // Traits below copied from Scala 2.12; not present in 2.13
-  // TODO: SPARK-30011 revisit once Scala 2.12 support is dropped
-  trait FloatIsConflicted extends Numeric[Float] {
-    def plus(x: Float, y: Float): Float = x + y
-    def minus(x: Float, y: Float): Float = x - y
-    def times(x: Float, y: Float): Float = x * y
-    def negate(x: Float): Float = -x
-    def fromInt(x: Int): Float = x.toFloat
-    def toInt(x: Float): Int = x.toInt
-    def toLong(x: Float): Long = x.toLong
-    def toFloat(x: Float): Float = x
-    def toDouble(x: Float): Double = x.toDouble
-    // logic in Numeric base trait mishandles abs(-0.0f)
-    override def abs(x: Float): Float = math.abs(x)
-    // Added from Scala 2.13; don't override to work in 2.12
-    def parseString(str: String): Option[Float] =
-      Try(java.lang.Float.parseFloat(str)).toOption
-  }
-
-  trait FloatAsIfIntegral extends FloatIsConflicted with Integral[Float] {
-    def quot(x: Float, y: Float): Float = {
-      (BigDecimal(x.toDouble) quot BigDecimal(y.toDouble)).floatValue
-    }
-    def rem(x: Float, y: Float): Float = {
-      (BigDecimal(x.toDouble) remainder BigDecimal(y.toDouble)).floatValue
-    }
-  }
-
-  object FloatAsIfIntegral extends FloatAsIfIntegral {
-    override def compare(x: Float, y: Float): Int = java.lang.Float.compare(x, 
y)
-  }
-}
+case object FloatType extends FloatType

Review Comment:
   Do we need to retain this object at all?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to