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

[NSE-370] Failed to get time zone: NoSuchElementException: None.get #371

Merged
merged 1 commit into from
Jun 21, 2021
Merged
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 @@ -468,7 +468,8 @@ class ColumnarCast(
val (child_node, childType): (TreeNode, ArrowType) =
child.asInstanceOf[ColumnarExpression].doColumnarCodeGen(args)

val toType = CodeGeneration.getResultType(dataType, zoneId.getId)
val toType = CodeGeneration.getResultType(dataType,
timeZoneId.getOrElse(SparkSchemaUtils.getLocalTimezoneID()))
val (child_node0, childType0) = childType match {
case ts: ArrowType.Timestamp =>
ConverterUtils.convertTimestampToMilli(child_node, childType)
Expand Down Expand Up @@ -560,7 +561,8 @@ class ColumnarCast(
val utcTimestampNodeLong = TreeBuilder.makeFunction("castBIGINT",
Lists.newArrayList(utcTimestampNodeMilli), new ArrowType.Int(64,
true))
val diff = SparkSchemaUtils.getTimeZoneIDOffset(zoneId.getId) *
val diff = SparkSchemaUtils.getTimeZoneIDOffset(
timeZoneId.getOrElse(SparkSchemaUtils.getLocalTimezoneID())) *
DateTimeConstants.MILLIS_PER_SECOND
val localizedTimestampNodeLong = TreeBuilder.makeFunction("add",
Lists.newArrayList(utcTimestampNodeLong,
Expand Down