Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/20858#discussion_r176901429
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
---
@@ -699,3 +699,88 @@ abstract class TernaryExpression extends Expression {
* and Hive function wrappers.
*/
trait UserDefinedExpression
+
+/**
+ * The trait covers logic for performing null save evaluation and code
generation.
+ */
+trait NullSafeEvaluation extends Expression
+{
+ override def foldable: Boolean = children.forall(_.foldable)
+
+ override def nullable: Boolean = children.exists(_.nullable)
+
+ /**
+ * Default behavior of evaluation according to the default nullability
of NullSafeEvaluation.
+ * If a class utilizing NullSaveEvaluation override [[nullable]],
probably should also
+ * override this.
+ */
+ override def eval(input: InternalRow): Any =
+ {
--- End diff --
There are other places where the braces `{}` style doesn't follow Spark
codes. We should keep the same code style.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]