You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "gengliangwang (via GitHub)" <gi...@apache.org> on 2026/09/11 19:11:03 UTC

Re: [PR] [SPARK-58235][SQL] Fix Double/Float to Timestamp silent overflow clamping in non-ANSI mode [spark]

gengliangwang commented on code in PR #58028:
URL: https://github.com/apache/spark/pull/58028#discussion_r3992564854


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:
##########
@@ -1022,7 +1022,18 @@ case class Cast(
     (d.toBigDecimal * MICROS_PER_SECOND).longValue
   }
   private[this] def doubleToTimestamp(d: Double): Any = {

Review Comment:
   There are also many other casting which will lead to slience overflows.  For example, Float/Double to Int. Why we changing timestamp specially? 
   Since ANSI mode is on by default now, shall we keep the legacy behavior as it is?
   



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org