Github user ueshin commented on the issue:

    https://github.com/apache/spark/pull/13873
  
    @cloud-fan Thank you for your review.
    I thought the problem is the schema would change after serialized by the 
`RowEncoder` because the schema after serialization will be retrieved from the 
serializer's attributes.
    
    For example, the following test will fail:
    
    ```
        val schema = new StructType()
          .add("array", ArrayType(StringType, containsNull = false), nullable = 
false)
        val ds1 = ...
        val ds2 = ds1.map(_ => Row(Array("1", "2", "3")))(RowEncoder(schema))
        assert(ds2.schema === schema)
    ```
    
    because `ds2.schema` becomes before this patch:
    
    ```
    root
     |-- array: array (nullable = true)
     |    |-- element: string (containsNull = true)
    ```
    
    , whereas after this patch (and this would be desirable):
    
    ```
    root
     |-- array: array (nullable = false)
     |    |-- element: string (containsNull = false)
    ```



---
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