gengliangwang commented on a change in pull request #25804: [SPARK-29096][SQL]
The exact math method should be called only when there is a corresponding
function in Math
URL: https://github.com/apache/spark/pull/25804#discussion_r324688319
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -1275,7 +1275,7 @@ case class Cast(child: Expression, dataType: DataType,
timeZoneId: Option[String
if ($longValue == ($integralType) $longValue) {
$evPrim = ($integralType) $longValue;
} else {
- throw new ArithmeticException("Casting $c to $integralType causes
overflow");
+ throw new ArithmeticException("Casting " + $c + " to $integralType
causes overflow");
Review comment:
They are different. The change you suggested is the same as what it is
originally.
Before:
```
Casting columnartorow_value_0 to short causes overflow
```
After:
```
Casting 4567890123456789 to short causes overflow
```
----------------------------------------------------------------
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]