Github user linbojin commented on the issue:
https://github.com/apache/spark/pull/16276
@srowen So any problems with my current implementation, i mean use
`implicit asTraversable: T => TraversableOnce[U]`. Because I refer to `flatten`
implementation in scala source code:
https://github.com/scala/scala/blob/05016d9035ab9b1c866bd9f12fdd0491f1ea0cbb/src/library/scala/collection/generic/GenericTraversableTemplate.scala#L169
and if user call flatten on invalid rdd, it will just error out:
```
scala> val rdd = sc.parallelize(Seq(1,2,3))
rdd: org.apache.spark.rdd.RDD[Int] = ParallelCollectionRDD[0] at
parallelize at <console>:24
scala> rdd.flatten
<console>:27: error: No implicit view available from Int =>
scala.collection.TraversableOnce[U].
rdd.flatten
^
```
same as scala
```
scala> val l = List(1,2,3)
l: List[Int] = List(1, 2, 3)
scala> l.flatten
<console>:13: error: No implicit view available from Int =>
scala.collection.GenTraversableOnce[B].
l.flatten
^
```
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]