Skip to content

[docs] Clarify sequence-group behavior when combined with aggregate functions#7420

Open
dyzcs wants to merge 1 commit intoapache:masterfrom
dyzcs:docs/clarify-sequence-group-with-aggregate-function
Open

[docs] Clarify sequence-group behavior when combined with aggregate functions#7420
dyzcs wants to merge 1 commit intoapache:masterfrom
dyzcs:docs/clarify-sequence-group-with-aggregate-function

Conversation

@dyzcs
Copy link

@dyzcs dyzcs commented Mar 13, 2026

Purpose

Linked issue: related to #5179

Users are frequently confused when sequence-group is combined with aggregate functions (e.g. sum, last_non_null_value), expecting it to act as a version filter (records with a smaller sequence value are ignored). However, when aggregate functions are involved, the sequence-group field acts as an ordering key: every record with a non-NULL sequence value participates in the aggregation, regardless of whether its value is larger or smaller than the currently stored one.

This PR clarifies the distinction by:

  1. Adding an informational note at the top of the "Aggregation For Partial Update" section that explicitly explains the behavioral difference between using sequence-group with and without aggregate functions.
  2. Fixing a misleading code comment -- a should not be updated in an existing example, which contradicted the shown output (a=6 via sum aggregation).

Tests

Documentation-only change. No tests required.

API and Format

No API or storage format changes.

Documentation

This PR itself is a documentation improvement. No additional documentation needed.

Generative AI tooling

Generated-by: Claude (Cursor AI assistant), used to help draft and review the documentation wording.

[docs] Clarify sequence-group behavior when combined with aggregate functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant