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

Commit

Permalink
[NSE-370] Failed to get time zone: NoSuchElementException: None.get (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer authored Jun 21, 2021
1 parent 19bfe50 commit e9c86f7
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit e9c86f7

Please sign in to comment.