Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PCollection<KV<String, Long>> ratingsCounts = csvRows
- .apply("Extract Ratings",
- FlatMapElements.into(TypeDescriptors.strings())
- .via(csvRow -> Arrays.asList(csvRow.split(",")[1])))
- .apply("Count Ratings", Count.<String>perElement());
Add Comment
Please, Sign In to add comment