Please sign in to comment.
[SPARK-26757][GRAPHX] Return 0 for `count` on empty Edge/Vertex RDDs
## What changes were proposed in this pull request? Previously a "java.lang.UnsupportedOperationException: empty collection" exception would be thrown due to using `reduce`, rather than `fold` or similar that can tolerate empty RDDs. This behaviour has existed for the Vertex RDDs since it was introduced in b30e0ae. It seems this behaviour was inherited by the Edge RDDs via copy-paste in ee29ef3. ## How was this patch tested? Two new unit tests. Closes #23681 from huonw/empty-graphx. Authored-by: Huon Wilson <Huon.Wilson@data61.csiro.au> Signed-off-by: Sean Owen <firstname.lastname@example.org> (cherry picked from commit da52698) Signed-off-by: Sean Owen <email@example.com>
- Loading branch information...
Showing with 33 additions and 3 deletions.
- +1 −1 graphx/src/main/scala/org/apache/spark/graphx/impl/EdgeRDDImpl.scala
- +1 −1 graphx/src/main/scala/org/apache/spark/graphx/impl/VertexRDDImpl.scala
- +1 −1 graphx/src/main/scala/org/apache/spark/graphx/lib/SVDPlusPlus.scala
- +10 −0 graphx/src/test/scala/org/apache/spark/graphx/EdgeRDDSuite.scala
- +11 −0 graphx/src/test/scala/org/apache/spark/graphx/VertexRDDSuite.scala
- +9 −0 graphx/src/test/scala/org/apache/spark/graphx/lib/SVDPlusPlusSuite.scala