Guest User

Untitled

a guest
Dec 15th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. PCollection<KV<String, Long>> ratingsCounts = csvRows
  2. .apply("Extract Ratings",
  3. FlatMapElements.into(TypeDescriptors.strings())
  4. .via(csvRow -> Arrays.asList(csvRow.split(",")[1])))
  5. .apply("Count Ratings", Count.<String>perElement());
Add Comment
Please, Sign In to add comment