cloud-fan commented on a change in pull request #30442:
URL: https://github.com/apache/spark/pull/30442#discussion_r529621021



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -453,7 +453,8 @@ abstract class CastBase extends UnaryExpression with 
TimeZoneAwareExpression wit
   // TimestampConverter
   private[this] def castToTimestamp(from: DataType): Any => Any = from match {
     case StringType =>
-      buildCast[UTF8String](_, utfs => DateTimeUtils.stringToTimestamp(utfs, 
zoneId).orNull)
+      buildCast[UTF8String](_,
+        utfs => DateTimeUtils.stringToTimestampAnsi(utfs, zoneId, 
ansiEnabled).orNull)

Review comment:
       We should call `stringToTimestampAnsi` when ansi mode is on, and call 
the original method when ansi mode is off.




----------------------------------------------------------------
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]



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

Reply via email to