Github user mateiz commented on a diff in the pull request:
https://github.com/apache/spark/pull/482#discussion_r11927603
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
---
@@ -244,3 +253,19 @@ abstract class UnaryExpression extends Expression with
trees.UnaryNode[Expressio
override def references = child.references
}
+
+/**
+ * Expression value will fall into 3 categories:
+ * 1) possible be null
+ * 2) always be null
+ * 3) never be null
+ * This will be great helpful in constant folding for the expression
evaluation
+ */
+case class Nullability(value: Int)
+
+// possible be null (in runtime)
+object possibleNull extends Nullability(0)
+// always be null
+object alwaysNull extends Nullability(-1)
+// never be null
+object neverNull extends Nullability(1)
--- End diff --
As a naming issue, objects like this should be capitalized (PossibleNull,
AlwaysNull, NeverNull). It might also be good to rename PossibleNull to
PossiblyNull.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---