Skip to content

Commit

Permalink
nullability
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyum committed Oct 28, 2021
1 parent c88566a commit 919492e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ object InferFiltersFromConstraints extends Rule[LogicalPlan]
// Whether the result of this expression may be null. For example: CAST(strCol AS double)
// We will infer an IsNotNull expression for this expression to avoid skew join.
private def resultMayBeNull(exp: Expression): Boolean = exp match {
case e if !e.nullable => false
case Cast(child: Attribute, dataType, _, _) => !Cast.canUpCast(child.dataType, dataType)
case c: Coalesce if c.children.forall(_.isInstanceOf[Attribute]) => true
case _ => false
Expand Down

0 comments on commit 919492e

Please sign in to comment.