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

    https://github.com/apache/spark/pull/22732#discussion_r225279364
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
 ---
    @@ -314,24 +314,24 @@ class AnalysisSuite extends AnalysisTest with 
Matchers {
         }
     
         // non-primitive parameters do not need special null handling
    -    val udf1 = ScalaUDF((s: String) => "x", StringType, string :: Nil)
    +    val udf1 = ScalaUDF((s: String) => "x", StringType, string :: Nil, 
false :: Nil)
         val expected1 = udf1
         checkUDF(udf1, expected1)
     
         // only primitive parameter needs special null handling
         val udf2 = ScalaUDF((s: String, d: Double) => "x", StringType, string 
:: double :: Nil,
    -      nullableTypes = true :: false :: Nil)
    +      false :: true :: Nil)
         val expected2 =
    -      If(IsNull(double), nullResult, udf2.copy(children = string :: 
KnownNotNull(double) :: Nil))
    +      If(IsNull(double), nullResult, udf2.copy(handleNullForInputs = false 
:: false :: Nil))
    --- End diff --
    
    Just checking my understanding -- string gets false because it's a 
reference type, and a double known to not be null also doesn't need null 
checking, so gets false. OK that sounds right.


---

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

Reply via email to