---
title: "Discussion on \"Stateful Aggregations in Spark Structured Streaming: mapGroupsWithState\" | Hashnode"
description: "Discussion on \"Stateful Aggregations in Spark Structured Streaming: mapGroupsWithState\". mapGroupsWithState gives you a per-key mutable state machine in a streaming pipeline — it is the right tool when windows are not enough"
url: "https://hashnode.com/posts/spark-stateful-aggregations-mapgroupswithstate/69e437e26e738bcf4b61fc35"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Stateful Aggregations in Spark Structured Streaming: mapGroupsWithState](https://abstractalgorithms.hashnode.dev/spark-stateful-aggregations-mapgroupswithstate?utm_source=hashnode&utm_medium=feed)

mapGroupsWithState gives you a per-key mutable state machine in a streaming pipeline — it is the right tool when windows are not enough

Apr 19 · 28 min read · abstractalgorithms.hashnode.dev  
Updated Jun 18  
Read the article

-   [#apache-spark](https://hashnode.com/tag/apache-spark)
-   [#structured-streaming](https://hashnode.com/tag/structured-streaming)
-   [#stateful-processing](https://hashnode.com/tag/stateful-processing)
-   [#advanced](https://hashnode.com/tag/advanced)

## Written by

[Abstract Algorithms](https://hashnode.com/@abstractalgorithms)

@abstractalgorithms

  
[View profile](https://hashnode.com/@abstractalgorithms)

Exploring the fascinating world of algorithms, data structures, and software engineering through clear explanations and practical examples.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
