Guest User

Untitled

a guest
Oct 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. val totalsAndProds = transByProd.leftOuterJoin(products)
  2. println(totalsAndProds.first())
  3.  
  4. (19,([Ljava.lang.String;@261ea657,Some([Ljava.lang.String;@25290bca)))
  5.  
  6. totalsAndProds.filter(x => x._2 == Some).first
  7.  
  8. Exception in thread "main" java.lang.UnsupportedOperationException: empty collection
  9. at org.apache.spark.rdd.RDD$$anonfun$first$1.apply(RDD.scala:1380)
  10. at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
  11. at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
  12. at org.apache.spark.rdd.RDD.withScope(RDD.scala:363)
  13. at org.apache.spark.rdd.RDD.first(RDD.scala:1377)
  14. at com.example.spark.WordCount$.main(WordCount.scala:98)
  15. at com.example.spark.WordCount.main(WordCount.scala)
  16.  
  17. totalsAndProds.filter{ case (_, (_, s)) => s.isDefined }
Add Comment
Please, Sign In to add comment