Bird
Raised Fist0

In Kafka Streams, what happens if you apply a filter operation followed by a map operation, and the filter removes all records?

hard🧠 Conceptual Q10 of Q15
Kafka - Streams
In Kafka Streams, what happens if you apply a filter operation followed by a map operation, and the filter removes all records?
AThe map operation throws a runtime exception
BThe map operation processes all original records anyway
CThe map operation receives no records and produces an empty stream
DThe filter operation is ignored and all records pass
Step-by-Step Solution
Solution:
  1. Step 1: Understand filter's effect on stream

    If filter removes all records, the downstream operations receive no data.
  2. Step 2: Effect on map operation

    Map processes only records passed from filter, so it receives none and outputs empty stream.
  3. Final Answer:

    The map operation receives no records and produces an empty stream -> Option C
  4. Quick Check:

    Filter empty = map empty output [OK]
Quick Trick: Filter empty means map gets no records [OK]
Common Mistakes:
MISTAKES
  • Expecting map to throw error
  • Thinking map processes original records
  • Assuming filter is ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes