dgd-contributor commented on a change in pull request #32666:
URL: https://github.com/apache/spark/pull/32666#discussion_r640610191
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
##########
@@ -839,8 +839,12 @@ object DateTimeUtils {
* is valid for the `toZone` time zone, thus the local date-time may be
adjusted.
*/
def convertTz(micros: Long, fromZone: ZoneId, toZone: ZoneId): Long = {
- val rebasedDateTime = getLocalDateTime(micros, toZone).atZone(fromZone)
- instantToMicros(rebasedDateTime.toInstant)
+ val localDateTime = toJavaTimestamp(micros).toLocalDateTime
+ val zonedDateTimeFromZone = ZonedDateTime.of(localDateTime, fromZone)
+ val zonedDateTimeToZone = zonedDateTimeFromZone.withZoneSameInstant(toZone)
+ val localDateTimeConverted = zonedDateTimeToZone.toLocalDateTime
+ val timestamp = Timestamp.valueOf(localDateTimeConverted)
Review comment:
So what should I used to resolve this, any hints? Thanks
--
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]