MaxGekk commented on pull request #34896:
URL: https://github.com/apache/spark/pull/34896#issuecomment-1001489660
@yoda-mon
1. Extend `TimeZoneAwareExpression` and add one more arg `timeZoneId` to the
case class
```scala
case class ConvertTimezone(
sourceTz: Expression,
targetTz: Expression,
sourceTs: Expression,
timeZoneId: Option[String] = None)
extends TernaryExpression
with ImplicitCastInputTypes
with NullIntolerant
with TimeZoneAwareExpression {
```
2. Override `withTimeZone()`
```scala
override def withTimeZone(timeZoneId: String): TimeZoneAwareExpression = {
copy(timeZoneId = Option(timeZoneId))
}
```
3. Add 2 constructors that take 2 and 3 arguments
```scala
def this(sourceTz: Expression, targetTz: Expression, sourceTs: Expression)
=
this(sourceTz, targetTz, sourceTs, None)
def this(targetTz: Expression, sourceTs: Expression) =
this(Literal("UTC", StringType), targetTz, sourceTs)
```
The source time zone in the second constructor doesn't matter since you are
not going to use it.
--
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]