https://github.com/apache/spark
Revision 2b5e033eb937a8074e454e1995616f8a1bf370f8 authored by Huon Wilson on 31 January 2019, 23:27:11 UTC, committed by Sean Owen on 31 January 2019, 23:27:46 UTC
## 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 b30e0ae0351be1cbc0b1cf179293587b466ee026. It seems this behaviour
was inherited by the Edge RDDs via copy-paste in
ee29ef3800438501e0ff207feb00a28973fc0769.

## 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 <sean.owen@databricks.com>
(cherry picked from commit da526985c7574dccdcc0cca7452e2e999a5b3012)
Signed-off-by: Sean Owen <sean.owen@databricks.com>
1 parent d9403e4
History
Tip revision: 2b5e033eb937a8074e454e1995616f8a1bf370f8 authored by Huon Wilson on 31 January 2019, 23:27:11 UTC
[SPARK-26757][GRAPHX] Return 0 for `count` on empty Edge/Vertex RDDs
Tip revision: 2b5e033

README.md

back to top