You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mgaido91 <gi...@git.apache.org> on 2018/10/04 09:49:18 UTC

[GitHub] spark pull request #22375: [SPARK-25388][Test][SQL] Detect incorrect nullabl...

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

    https://github.com/apache/spark/pull/22375#discussion_r222604455
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvalHelper.scala ---
    @@ -69,11 +69,17 @@ trait ExpressionEvalHelper extends GeneratorDrivenPropertyChecks with PlanTestBa
     
       /**
        * Check the equality between result of expression and expected value, it will handle
    -   * Array[Byte], Spread[Double], MapData and Row.
    +   * Array[Byte], Spread[Double], MapData and Row. Also check whether exprNullable is true
    +   * if result of expression is null
        */
    -  protected def checkResult(result: Any, expected: Any, exprDataType: DataType): Boolean = {
    +  protected def checkResult(
    +      result: Any,
    +      expected: Any,
    +      exprDataType: DataType,
    +      exprNullable: Boolean): Boolean = {
         val dataType = UserDefinedType.sqlType(exprDataType)
     
    +    assert(result != null || exprNullable)
    --- End diff --
    
    Can we add a description which is more clear about the issue? Something like: `The result is null for a non-nullable expression`?


---

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