You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2018/12/27 14:18:22 UTC
[GitHub] HyukjinKwon commented on issue #21732: [SPARK-24762][SQL] Enable
Option of Product encoders
HyukjinKwon commented on issue #21732: [SPARK-24762][SQL] Enable Option of Product encoders
URL: https://github.com/apache/spark/pull/21732#issuecomment-450158698
Hm .. sorry for joining this party late. I was reading and testing it by myself.
```scala
scala> Seq((1, "a"), (2, "b")).toDF.show()
+---+---+
| _1| _2|
+---+---+
| 1| a|
| 2| b|
+---+---+
scala> Seq(1, 2).toDF.show()
+-----+
|value|
+-----+
| 1|
| 2|
+-----+
```
```scala
scala> Seq(Some((1, "a")), Some((2, "b"))).toDF.show()
+------+
| value|
+------+
|[1, a]|
|[2, b]|
+------+
scala> Seq(Some(1), Some(2)).toDF.show()
+-----+
|value|
+-----+
| 1|
| 2|
+-----+
```
I think this behaviour can be actually controversial. If we interpret `Option` as existent/missing value. Why did we interpret `Option` as `Tuple1`?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org