mihailoale-db commented on code in PR #59271:
URL: https://github.com/apache/spark/pull/59271#discussion_r4228947958


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala:
##########
@@ -1764,9 +1764,10 @@ case class Unpivot(
     ids.exists(_.forall(_.resolved))
 
   def valuesTypeCoercioned: Boolean = canBeCoercioned &&
-    // all inner values at position idx must have the same data type
+    // all inner values at position idx must have exactly the same data type, 
including nested
+    // nullability, because the value column takes the data type of the first 
value
     values.get.head.zipWithIndex.forall { case (v, idx) =>
-      values.get.tail.forall(vals => 
DataTypeUtils.sameType(vals(idx).dataType, v.dataType))
+      values.get.tail.forall(vals => vals(idx).dataType == v.dataType)

Review Comment:
   Done!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to