Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22732#discussion_r225280432
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala ---
    @@ -124,8 +124,10 @@ class UDFRegistration private[sql] (functionRegistry: 
FunctionRegistry) extends
             |  val ScalaReflection.Schema(dataType, nullable) = 
ScalaReflection.schemaFor[RT]
             |  val inputSchemas: Option[Seq[ScalaReflection.Schema]] = 
Try($inputSchemas).toOption
             |  def builder(e: Seq[Expression]) = if (e.length == $x) {
    -        |    ScalaUDF(func, dataType, e, 
inputSchemas.map(_.map(_.dataType)).getOrElse(Nil), Some(name), nullable,
    -        |      udfDeterministic = true, nullableTypes = 
inputSchemas.map(_.map(_.nullable)).getOrElse(Nil))
    +        |    ScalaUDF(func, dataType, e,
    +        |      inputSchemas.map(_.map(!_.nullable)).getOrElse(e.map(_ => 
false)),
    --- End diff --
    
    Passing !nullable instead of nullable, yep, looks right. The meaning is 
flipped here, correct.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to