Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[NSE-1034] Add timeZoneId in ColumnarUnixTimestamp #1035

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ object ColumnarBinaryExpression {
case s: DateDiff =>
new ColumnarDateDiff(left, right)
case a: UnixTimestamp =>
new ColumnarUnixTimestamp(left, right)
new ColumnarUnixTimestamp(left, right, a.timeZoneId, a.failOnError)
// To match GetTimestamp (a private class).
case _ if (original.isInstanceOf[ToTimestamp] && original.dataType == TimestampType) =>
// Convert a string to Timestamp. Default timezone is used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,12 @@ object ColumnarDateTimeExpressions {
* The input is the date/time for local timezone (can be configured in spark) and the result is
* the timestamp for UTC. So we need consider timezone difference.
* */
class ColumnarUnixTimestamp(left: Expression, right: Expression)
extends UnixTimestamp(left, right) with
class ColumnarUnixTimestamp(
left: Expression,
right: Expression,
timeZoneId: Option[String] = None,
failOnError: Boolean = SQLConf.get.ansiEnabled)
extends UnixTimestamp(left, right, timeZoneId, failOnError) with
ColumnarExpression {

val yearMonthDayFormat = "yyyy-MM-dd"
Expand Down