Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/21611
  
    Based on the comment, this null check is for preventing encoding a Product 
type to a null top-level row. For `Option[Int]`, it is encoded to an int column 
in a top-level row.
    
    An example looks like:
    
    ```scala
    val df = Seq(Some(1), Some(2), null, None).toDS()
    df.show()
    ```
    
    ```
    +-----+
    |value|
    +-----+
    |    1|
    |    2|
    | null|
    | null|
    +-----+
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to