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

    https://github.com/apache/spark/pull/15780#discussion_r90482546
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala 
---
    @@ -969,6 +972,53 @@ class DatasetSuite extends QueryTest with 
SharedSQLContext {
         assert(dataset.collect() sameElements Array(resultValue, resultValue))
       }
     
    +  test("SPARK-18284: Serializer should have correct nullable value") {
    +    val df1 = Seq(1, 2, 3, 4).toDF
    +    assert(df1.schema(0).nullable == false)
    +    val df2 = Seq(Integer.valueOf(1), Integer.valueOf(2)).toDF
    +    assert(df2.schema(0).nullable == true)
    +
    +    val df3 = Seq(Seq(1, 2), Seq(3, 4)).toDF
    +    assert(df3.schema(0).nullable == true)
    +    assert(df3.schema(0).dataType.asInstanceOf[ArrayType].containsNull == 
false)
    +    val df4 = Seq(Seq("a", "b"), Seq("c", "d")).toDF
    +    assert(df4.schema(0).nullable == true)
    +    assert(df4.schema(0).dataType.asInstanceOf[ArrayType].containsNull == 
true)
    +
    +    val df5 = Seq((0, 1.0), (2, 2.0)).toDF("id", "v")
    +    assert(df5.schema(0).nullable == false)
    +    assert(df5.schema(1).nullable == false)
    +    val df6 = Seq((0, 1.0, 3.0), (2, 2.0, 5.0)).toDF("id", "v1", "v2")
    --- End diff --
    
    i see. done


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to