Here, for compatibility with Spark 0.8.0, I wouldn't use this new Random. Instead we can update to it in Spark 0.9.