dongjoon-hyun commented on issue #23620: [SPARK-26696][SQL] Makes Dataset 
encoder public
URL: https://github.com/apache/spark/pull/23620#issuecomment-462405179
 
 
   @ssimeonov . It's partially true.
   > the test did not work before as it accessed a private property that this 
PR made public.
   
   @HyukjinKwon . The following was @ssimeonov 's test case.
   ```
   test("as tuple using instance encoder") {
       val data = Seq(("a", 1), ("b", 2), ("c", 3))
       val ds = data.toDS()
       checkDataset(
         ds.toDF().as[(String, Int)](ds.encoder),
         data: _*)
     }
   ```
   
   The problem of @ssimeonov 's test case was that the following works . So, 
@gatorsmile and I had a doubt about that.
   ```
   test("as tuple using instance encoder") {
       val data = Seq(("a", 1), ("b", 2), ("c", 3))
       val ds = data.toDS()
       checkDataset(
         ds.toDF().as[(String, Int)],
         data: _*)
     }
   ```
   
   What @ssimeonov is saying is that `ds.encoder` will not be parsed.
   
   In addition, @ssimeonov also suggested another example in the comment. But, 
we prefer to keep this PR simple.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to