dongjoon-hyun commented on code in PR #60648:
URL: https://github.com/apache/spark/pull/60648#discussion_r4617584978
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/UpdateAttributeNullability.scala:
##########
@@ -48,9 +48,25 @@ object UpdateAttributeNullability extends Rule[LogicalPlan] {
// For an Attribute used by the current LogicalPlan, if it is from its
children,
// we fix the nullable field by using the nullability setting of the
corresponding
// output Attribute from the children.
- p.transformExpressions {
+ val newPlan = p.transformExpressions {
case attr: Attribute if nullabilities.contains(attr.exprId) =>
attr.withNullability(nullabilities(attr.exprId))
}
+ newPlan match {
+ case m: MergeRows => widenOutputNullability(m)
Review Comment:
Thank you, @peter-toth. Yes, both cases match my local runs, and the
description understated the first one. I updated the description to say that an
insert-only `MERGE` with multiple `NOT MATCHED` clauses into a `NOT NULL`
column now fails even when no `NULL` reaches the UDF, that a `MATCHED` `UPDATE`
with a `NULL` input now writes a `NULL` with whole-stage codegen, and that
SPARK-61935 (#60651) fixes both at the source, which matters for a branch that
takes this PR without it.
--
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]