Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/21687#discussion_r199434991
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala
---
@@ -129,7 +129,7 @@ case class CaseWhen(
case Seq(dt1, dt2) => dt1.sameType(dt2)
}
- override def dataType: DataType = branches.head._2.dataType
+ override def dataType: DataType =
valueTypes.reduce(TypeCoercion.findTightestCommonType(_, _).get)
--- End diff --
I see. Looks correct to me.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]