From 0857791bc310f54dd8ed1f4bcf5a5b274ffa33c6 Mon Sep 17 00:00:00 2001 From: Wenchen Fan Date: Mon, 7 Sep 2020 14:45:11 +0800 Subject: [PATCH] fix test --- .../org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala index c1e7e1880b86a..deaa49bf423b1 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala @@ -403,7 +403,8 @@ object TypeCoercion { /** Given a plan, add an extra project on top to widen some columns' data types. */ private def widenTypes(plan: LogicalPlan, targetTypes: Seq[DataType]): LogicalPlan = { val casted = plan.output.zip(targetTypes).map { - case (e, dt) if e.dataType != dt => Alias(Cast(e, dt), e.name)() + case (e, dt) if e.dataType != dt => + Alias(Cast(e, dt, Some(SQLConf.get.sessionLocalTimeZone)), e.name)() case (e, _) => e } Project(casted, plan)