Skip to content

fix(iox_query_influxql): correct SPREAD when all values are negative#27403

Open
o6ivp wants to merge 1 commit into
influxdata:mainfrom
o6ivp:fix/influxql-spread-negative-values
Open

fix(iox_query_influxql): correct SPREAD when all values are negative#27403
o6ivp wants to merge 1 commit into
influxdata:mainfrom
o6ivp:fix/influxql-spread-negative-values

Conversation

@o6ivp

@o6ivp o6ivp commented May 3, 2026

Copy link
Copy Markdown

Closes #27384

SpreadAccumulator initialised the running max to zero rather than NULL, so all-negative inputs evaluated 0 - min instead of max - min (all -3.6 returned 3.6). Initialise max to NULL and check is_null() in maybe_set_max, mirroring the existing min path.

  • I've read the contributing section of the project README.
  • Signed CLA (if not already signed).

`SpreadAccumulator` initialised `max` to zero, so all-negative inputs
produced `0 - min` instead of `max - min` (all -3.6 returned 3.6
instead of 0). Initialise `max` to NULL and check `is_null()` in
`maybe_set_max`, mirroring the `min` path.

Closes influxdata#27384
@philjb

philjb commented May 4, 2026

Copy link
Copy Markdown
Contributor

nice fix. thanks.

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.

[v3] InfluxQL SPREAD function gives wrong results

2 participants