Github user mn-mikke commented on the issue: https://github.com/apache/spark/pull/21687 @viirya Yeah, it looks like the same problem, but It's worked around via different implementation of ```IfCoercion``` rule. This rule utilizes ```!=``` operator for comparison. So if two types differ in nullability flags, casting is applied to get the types alligned. ```CaseWhenCoercion``` rule utilizes ```sameType``` instead. We could change this rule according to the ```IfCoercion``` rule, but is it neccesary to do that? An extra ```Cast``` expression won't perform any effective casting (int to int, string to string,...). We just need to supply correct meta-data information to parent expressions to perform null-safe codegen. Personally, I would resolve this nullability problem in expressions, not it coercion rules. WDYT?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org