Skip to content

Instantly share code, notes, and snippets.

@jacace
Created February 10, 2021 10:37
Show Gist options
  • Save jacace/27b433c4b173868859fac5c4e3853443 to your computer and use it in GitHub Desktop.
Save jacace/27b433c4b173868859fac5c4e3853443 to your computer and use it in GitHub Desktop.
Transform each record in one stream vs another (kafka vs Spark streamign APIs)
#With Kafka Streaming API:
stream.mapValues(value -> value.toLowerCase());
#With Spark Streaming API:
stream.map(record -> new Tuple2<>(record.key(), record.value()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment