dongjoon-hyun commented on code in PR #60695:
URL: https://github.com/apache/spark/pull/60695#discussion_r4632832529
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/UpdateAttributeNullability.scala:
##########
@@ -69,4 +70,18 @@ object UpdateAttributeNullability extends Rule[LogicalPlan] {
}
if (newOutput == m.output) m else m.copy(output = newOutput)
}
+
+ // Expand derives the nullability of its new output attributes from its
projections when it is
+ // built, for instance, for grouping sets or UNPIVOT. The projections may
become nullable later
+ // when this rule updates the attributes they reference, e.g., a column of a
Dataset that an
+ // outer join makes nullable, so widen the nullability of the output
attributes accordingly,
+ // keeping their expression IDs.
+ private def widenOutputNullability(e: Expand): Expand = {
+ val projections = e.projections.map(_.toIndexedSeq)
+ val newOutput = e.output.zipWithIndex.map { case (attr, index) =>
+ attr.withNullability(
Review Comment:
I filed SPARK-62094 for the nested nullability and opened #60728.
--
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]