cloud-fan commented on code in PR #43694:
URL: https://github.com/apache/spark/pull/43694#discussion_r1423032246
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:
##########
@@ -1658,22 +1661,26 @@ case class Cast(
integralType: String,
from: DataType,
to: DataType): CastFunction = {
- if (ansiEnabled) {
- val longValue = ctx.freshName("longValue")
- val fromDt = ctx.addReferenceObj("from", from, from.getClass.getName)
- val toDt = ctx.addReferenceObj("to", to, to.getClass.getName)
- (c, evPrim, _) =>
- code"""
+
+ val longValue = ctx.freshName("longValue")
+ val fromDt = ctx.addReferenceObj("from", from, from.getClass.getName)
+ val toDt = ctx.addReferenceObj("to", to, to.getClass.getName)
+
+ (c, evPrim, evNull) =>
+ val overflow = if (ansiEnabled) {
Review Comment:
I think we can skip the overflow handling if the `to` data type is LongType?
--
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]