Skip to content

Instantly share code, notes, and snippets.

@sandboxws
Created December 15, 2018 03:59
Show Gist options
  • Select an option

  • Save sandboxws/6d216556fb4e9c00425d860323393898 to your computer and use it in GitHub Desktop.

Select an option

Save sandboxws/6d216556fb4e9c00425d860323393898 to your computer and use it in GitHub Desktop.
ratingsCounts
.apply("FormatResults", MapElements.into(TypeDescriptors.strings())
.via((KV<String, Long> ratingsCount) -> ratingsCount.getKey() + " " + ratingsCount.getValue()))
.apply(TextIO.write().to("./ratings_results").withSuffix(".csv"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment