MaxGekk commented on a change in pull request #32878: URL: https://github.com/apache/spark/pull/32878#discussion_r649823568
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ########## @@ -513,6 +514,8 @@ abstract class CastBase extends UnaryExpression with TimeZoneAwareExpression wit private[this] def castToTimestampWithoutTZ(from: DataType): Any => Any = from match { case DateType => buildCast[Int](_, d => daysToMicros(d, ZoneOffset.UTC)) + case TimestampType => + buildCast[Long](_, ts => ts) Review comment: Should we consider the input timestamp w/o tz as local offset. How about the chain: input micros -> instant (UTC) -> local timestamp (UTC) = local timestamp (session TZ) -> instant -> result in micros In your implementation, you say that timestamp w/o TZ is a timestamp in UTC, and it is not local timestamp. -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org