Github user kanzhang commented on the pull request:
https://github.com/apache/spark/pull/760#issuecomment-43373217
@witgo I'm not sure it is the correct semantics (@mateiz ?), but based on
how we partition sequences, that is expected. We zip by partition (see below).
Btw, as we discussed in #776, there is currently a bug in Scala
NumericRange[Double].take() (https://issues.scala-lang.org/browse/SI-8518),
which is causing parallelize() on Double to be wrong. For the purpose of this
discussion, let's just assume the following partition results are correct.
```
scala> sc.parallelize((1D to 2D).by(0.2),4).collectPartitions
res1: Array[Array[Double]] = Array(Array(1.0), Array(1.2), Array(1.6),
Array(1.8))
scala> sc.parallelize(11 to 12,4).collectPartitions
res2: Array[Array[Int]] = Array(Array(), Array(11), Array(), Array(12))
```
Speaking of current way of partitioning, the following result is also
curious.
```
scala> sc.parallelize(1 to 3, 2).collectPartitions
res10: Array[Array[Int]] = Array(Array(1), Array(2, 3))
```
---
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.
---