Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/15901#discussion_r88386690
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
---
@@ -33,6 +33,88 @@ import
org.apache.spark.sql.catalyst.util.{ArrayBasedMapData, GenericArrayData}
import org.apache.spark.sql.types._
/**
+ * Common base class for [[StaticInvoke]], [[Invoke]], and [[NewInstance]].
+ */
+trait InvokeLike {
+
+ def arguments: Seq[Expression]
+
+ def propagateNull: Boolean
+
+ protected lazy val propagatingNull: Boolean = propagateNull &&
arguments.exists(_.nullable)
+
+ /**
+ * Prepares codes for arguments.
+ *
+ * - generate codes for argument.
+ * - use ctx.splitExpressions() not to exceed 64kb JVM limit while
preparing arguments.
+ * - avoid some of nullabilty checking which are not needed because the
expression is not
+ * nullable.
+ * - when progagateNull == true, short circuit if we found one of
arguments is null because
--- End diff --
`progagateNull` -> `propagatingNull`? Actually can we think of better name
than `propagatingNull`? how about `needNullCheck` ?
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]