Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/17114#discussion_r104115235
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveInlineTables.scala
---
@@ -95,10 +95,14 @@ object ResolveInlineTables extends Rule[LogicalPlan] {
InternalRow.fromSeq(row.zipWithIndex.map { case (e, ci) =>
val targetType = fields(ci).dataType
try {
- if (e.dataType.sameType(targetType)) {
- e.eval()
+ val castedExpr = if (e.dataType.sameType(targetType)) {
+ e
} else {
- Cast(e, targetType).eval()
+ Cast(e, targetType)
+ }
+ castedExpr match {
+ case te: TimeZoneAwareExpression =>
te.withTimeZone(conf.sessionLocalTimeZone).eval()
--- End diff --
Or did `ResolveTimeZone` already process the input expression? In that case
just add the timezone to the cast.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]