You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Jungtaek Lim (Jira)" <ji...@apache.org> on 2026/10/03 13:34:00 UTC
[jira] [Resolved] (SPARK-59788) Initialize the global aggregation once per empty batch in the streamline plan
[ https://issues.apache.org/jira/browse/SPARK-59788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jungtaek Lim resolved SPARK-59788.
----------------------------------
Fix Version/s: 4.4.0
Resolution: Fixed
Issue resolved by pull request 59048
[https://github.com/apache/spark/pull/59048]
> Initialize the global aggregation once per empty batch in the streamline plan
> -----------------------------------------------------------------------------
>
> Key: SPARK-59788
> URL: https://issues.apache.org/jira/browse/SPARK-59788
> Project: Spark
> Issue Type: Bug
> Components: SQL, Structured Streaming
> Affects Versions: 4.4.0
> Reporter: Jonathan Gao
> Assignee: Jonathan Gao
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.4.0
>
>
> A global streaming aggregation on the streamline (Real-Time Mode) plan drops the initialized result for an executed empty batch:
> * a source batch whose RDD has no partitions: the buffer is never initialized, no state is created, and no row is emitted;
> * a batch with multiple empty partitions: one seeded row per empty partition (duplicate rows);
> * a non-empty batch that has an empty sibling partition: an extra seeded row.
> The ordinary micro-batch plan initializes the global buffer exactly once and emits the initialized result (count 0, sum NULL) for an executed empty batch, so the streamline plan diverges from it.
> Fix: plan the non-final ProjectAggregationBufferExec with a single-partition (AllTuples) requirement for a global aggregation, so its empty-input guard fires exactly once per executed empty batch and never for a batch that has input. The projection propagates the single partition, so the plan keeps exactly one exchange; grouped aggregations are unchanged.
> Follow-up to SPARK-58635.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org