gengliangwang commented on a change in pull request #24849: [SPARK-28018][SQL]
Allow upcasting decimal to double/float
URL: https://github.com/apache/spark/pull/24849#discussion_r292791870
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/types/DecimalType.scala
##########
@@ -77,6 +77,7 @@ case class DecimalType(precision: Int, scale: Int) extends
FractionalType {
(precision - scale) >= (dt.precision - dt.scale) && scale >= dt.scale
case dt: IntegralType =>
isWiderThan(DecimalType.forType(dt))
+ // For DoubleType/FloatType, the value can be NaN, PositiveInfinity or
NegativeInfinity.
Review comment:
This PR also added comment to explain why we can't upcast double/float to
decimal.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]