Github user koertkuipers commented on the issue:

    https://github.com/apache/spark/pull/15979
  
    this means anything that uses an encoder can no longer use Option[_ <: 
Product].
    encoders are not just used for the top level Dataset creation.
    
    Dataset.groupByKey[K] requires an encoder for K.
    KeyValueGroupedDataset.mapValues[W] requires an encoder for V
    Aggregator[A, B, C] requires encoders for B and C
    
    none of these always create top level row objects (for which this pullreq 
creates the restriction that they cannot be null).
    
    for an aggregator it is sometimes the case. 
```dataset.select(aggregator)``` does create a top level row object, but 
```dataset.groupByKey(...).agg(aggregator)``` does not.
    
    so i am not sure it makes sense to put this restriction on the encoder. it 
seems to belong on the dataset.
    
    another example of something that won't work anymore:
    ```
    val x: Dataset[String, Option[(String, String)]] = ...
    x.groupByKey(_._1).mapValues(_._2).agg(someAgg)
    ```
    in this case the mapValues requires``` Encoder[Option[(String, String)]]```


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