Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/15780#discussion_r89716676
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
---
@@ -177,9 +177,10 @@ case class Invoke(
functionName: String,
dataType: DataType,
arguments: Seq[Expression] = Nil,
- propagateNull: Boolean = true) extends InvokeLike {
+ propagateNull: Boolean = true,
+ returnNullable : Boolean = true) extends InvokeLike {
- override def nullable: Boolean = true
+ override def nullable: Boolean = targetObject.nullable || returnNullable
--- End diff --
If `returnNullable` is given false from caller, I think it means we do make
sure this `Invoke` won't return a null value, e.g., for a primitive type. And
it should be even `needNullCheck` is true.
Under this case (`returnNullable == false`), the only case this `Invoke`
returning null should be `targetObject` is nullable.
---
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]