Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21732#discussion_r230726457
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala 
---
    @@ -1556,6 +1547,54 @@ class DatasetSuite extends QueryTest with 
SharedSQLContext {
           df.where($"city".contains(new java.lang.Character('A'))),
           Seq(Row("Amsterdam")))
       }
    +
    +  test("SPARK-24762: Enable top-level Option of Product encoders") {
    +    val data = Seq(Some((1, "a")), Some((2, "b")), None)
    +    val ds = data.toDS()
    +
    +    checkDataset(
    +      ds,
    +      data: _*)
    +
    +    val schema = StructType(Seq(
    --- End diff --
    
    can we use the `add` API? e.g.
    ```
    new StructType().add(
      "value",
      new StructType()
        .add("_1", ...)
        .add("_2", ...))
    ```


---

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

Reply via email to