apache/spark — pull request #135 by CodingCat (2014-03-13 18:22:36+00:00)
Title: SPARK-1240: handle the case with empty RDD when take sample

https://spark-project.atlassian.net/browse/SPARK-1240

It seems that the current implementation does not handle the empty RDD case when run takeSample

In this patch, before calling sample() inside takeSample API, I add a checker for this case and returns an empty Array when it's a empty RDD; also in sample(), I add a checker for the invalid fraction value

In the test case, I also add several lines for this case