Skip to content
DigitalNeuron
Tools & products

Databricks Adds On-Demand State Repartitioning for Spark Structured Streaming

Databricks announced a Public Preview feature letting Structured Streaming queries change partition counts without rebuilding checkpoints.

By DigitalNeuron Desk2 min read

Quick answer

What did Databricks announce for Apache Spark Structured Streaming state management?

Databricks announced on-demand state repartitioning, a Public Preview feature in Databricks Runtime 18 and above that lets stateful Structured Streaming queries change their partition count by restarting with a new configuration, without losing or rebuilding checkpoint state.

Key takeaways

  • Databricks announced on-demand state repartitioning for Apache Spark Structured Streaming, now in Public Preview on Databricks Runtime 18 and above.
  • The feature lets users change a stateful streaming query's partition count via the new spark.sql.streaming.stateStore.partitions setting, which takes precedence over spark.sql.shuffle.partitions for stateful queries.
  • Previously, partition counts were locked at checkpoint creation, and changing spark.sql.shuffle.partitions had no effect without discarding the checkpoint and losing accumulated state.
  • Databricks says the requirements are Databricks Runtime 18 or above and the RocksDB state store provider, which is the default in DBR 17.3 and above.
  • Databricks says early adopter Coveo cut related Amazon S3 API costs by 40% after using the capability, according to a quote from Coveo's Alexis Chicoine included in the announcement.

Databricks announced on-demand state repartitioning for Apache Spark Structured Streaming, a Public Preview capability that lets engineers resize the number of partitions in a stateful streaming query without rebuilding the checkpoint or losing accumulated state. The feature is available in Databricks Runtime 18 and above.

What changed

According to Databricks, stateful streaming queries have historically had their partition count locked in at the moment the checkpoint was created. Changing the standard spark.sql.shuffle.partitions setting and restarting the query had no effect, because the partition layout was baked into the checkpoint. The only prior option, Databricks says, was to discard the checkpoint and start a new one, which meant losing all state the query had built up, such as fraud-tracking data across millions of accounts or multi-day session windows.

Databricks says on-demand state repartitioning removes that restriction. It applies to any stateful streaming query, including aggregations, stream-stream joins, deduplication, sessionization, and transformWithState workloads.

How it works

Databricks says users set a dedicated configuration, spark.sql.streaming.stateStore.partitions, and restart the query. This setting takes precedence over spark.sql.shuffle.partitions for stateful queries. Upon restart, the query first completes any pending microbatch, then performs a one-time repartition operation that physically redistributes state data across the new partition count, re-hashing keys into their correct locations. Once that completes, the query resumes processing under the new partition count.

Databricks says the requirements to use the feature are Databricks Runtime 18 or above and the RocksDB state store provider, which is the default for new queries created on DBR 17.3 and above.

Monitoring

Databricks says the repartition operation's duration appears in standard StreamingQueryProgress events, specifically in the durationMs metrics under a field called controlBatch.REPARTITION. The company says repartition time is proportional to the amount of state involved but expects it to take only a few seconds for most workloads.

Use cases cited

Databricks describes three scenarios for the feature: right-sizing a query after launch, when an initial partition count set for a small pilot no longer fits growth, such as a fraud-scoring stream expanding from one region to many; adjusting for changing workloads, such as an ad-bidding pipeline that could scale partitions up for daytime traffic and down overnight; and backfilling historical data, where a higher partition count could be used temporarily to speed up reprocessing of past data before scaling back down for steady-state traffic.

Customer example

Databricks quoted Alexis Chicoine, Senior Software Developer at Coveo, an early adopter of the feature, saying Coveo runs large-scale stateful streaming pipelines with fluctuating data volumes and has cut related Amazon S3 API costs by 40% using the capability. Chicoine said the company previously had to choose between overprovisioning or rebuilding from new checkpoints, which drove storage API costs close to compute costs, and can now scale without disrupting existing state or triggering checkpoint migrations.

Source: Databricks blog, "Announcing On-Demand State Repartitioning for Apache Spark™ Structured Streaming on Databricks," published September 14, 2026.

Frequently asked questions

What is on-demand state repartitioning?
It is a Public Preview feature from Databricks that lets a stateful Apache Spark Structured Streaming query change its number of state partitions by stopping and restarting the query, while keeping the existing checkpoint state intact.
What do I need to use it?
Databricks says you need Databricks Runtime 18 or above and the RocksDB state store provider, which is already the default for new queries created on DBR 17.3 and above.
How do I change the partition count?
Databricks says you stop the query, set the spark.sql.streaming.stateStore.partitions configuration to the new value, and restart the query using the same checkpoint; the query then redistributes state to match the new count before resuming processing.
How can I monitor the repartition operation?
Databricks says the StreamingQueryProgress events report the operation's duration in the durationMs metrics under the controlBatch.REPARTITION field.

Sources

  1. Announcing On-Demand State Repartitioning for Apache Spark™ Structured Streaming on Databricks | Databricks BlogDatabricks
Tagsdatabricksapache-sparkstructured-streamingdata-engineeringcheckpointingpublic-preview

Related reading

Databricks Says Internal AI Assistant Tripled Marketers' Use of Data

Databricks says its marketing team built Marge, a Genie Agents-based conversational analytics assistant, on a governed Marketing Lakehouse. The company reports marketers now use data three times more often in decisions, adoption exceeds 85% of the marketing organization, and flagged incorrect responses have dropped 25%.

2 min read

Databricks Says Internal AI Assistant Tripled Marketers' Use of Data

Databricks says it built Marge, an AI analytics assistant powered by Genie Agents and grounded in a governed Marketing Lakehouse, that lets marketers ask questions in natural language. The company reports marketers now use data three times more often in decisions, with adoption exceeding 85% of the marketing organization.

2 min read