cloud-fan commented on a change in pull request #23726: [SPARK-26812][SQL]
Report correct nullability for complex datatypes in Union
URL: https://github.com/apache/spark/pull/23726#discussion_r270728645
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
##########
@@ -235,9 +237,28 @@ case class Union(children: Seq[LogicalPlan]) extends
LogicalPlan {
}
// updating nullability to make all the children consistent
- override def output: Seq[Attribute] =
- children.map(_.output).transpose.map(attrs =>
- attrs.head.withNullability(attrs.exists(_.nullable)))
+ override def output: Seq[Attribute] = {
+ children.map(_.output).transpose.map { attrs =>
+ val firstAttr = attrs.head
+ val nullable = attrs.exists(_.nullable)
+ try {
Review comment:
this is a minor bug fix and I think no backport is needed. This try-cache
looks overkill now.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]