liveBook · Manning

mapValues

mapValues is an operation that transforms values associated with keys while preserving those keys.

How 2 Manning books explain it

Kafka Streams in Action, Second Edition

KStream.mapValues is a Kafka Streams operation that maps each record value to a new value while retaining the record key.

How it is used
Transforms incoming record values as a processing node between a KStream source and downstream operations.
How deep it goes
Defines mapper interfaces, key-preservation behavior, and topology placement, while deferring lambda-expression instruction to external documentation.
Examples
Demonstrates uppercasing text, masking RetailPurchase credit-card numbers, and converting proximity readings from feet to meters.
What you can do after
Apply it via Kafka Streams to transform each record value while retaining its existing key.

Read how Kafka Streams in Action, Second Edition explains mapValues →

Apache Kafka in Action

mapValues is a stream-processing function that transforms record values while preserving their keys.

How it is used
Transforms stream values for conversion, masking, and reshaping while preserving record keys.
How deep it goes
Defines value-only transformation, demonstrates price conversion, and explains repartitioning consequences without detailing processor internals.
Examples
Demonstrates converting prices from dollars to cents and projecting averages from aggregate state.
What you can do after
Apply via Kafka Streams to transform values without changing keys or unnecessarily causing repartitioning.

Read how Apache Kafka in Action explains mapValues →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.