Skip to content

Round Float64 results in test 02931_rewrite_sum_column_and_constant#100409

Merged
alexey-milovidov merged 1 commit intoadd-arm-build-variants-and-stress-testsfrom
fix-02931-float-rounding
Mar 23, 2026
Merged

Round Float64 results in test 02931_rewrite_sum_column_and_constant#100409
alexey-milovidov merged 1 commit intoadd-arm-build-variants-and-stress-testsfrom
fix-02931-float-rounding

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

Test 02931_rewrite_sum_column_and_constant fails under TSan with random settings due to floating-point precision differences. When optimize_arithmetic_operations_in_aggregate_functions is disabled, sum(2.11 - uint64) produces -4.45 instead of -4.450000000000001. Both are valid results for the same mathematical value. Wrap Float64 arithmetic queries with round(..., 2) to avoid flaky results.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98677&sha=c1d06924bbc951a62ad4a320efdcb22722d72d4b&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%202%2F2%29

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

The test fails with TSan due to floating-point precision differences
when random settings change the evaluation order of sum(constant - column).
Wrap Float64 arithmetic queries with `round(..., 2)` to avoid flaky results.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98677&sha=c1d06924bbc951a62ad4a320efdcb22722d72d4b&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%202%2F2%29

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-milovidov alexey-milovidov merged commit c8f42af into add-arm-build-variants-and-stress-tests Mar 23, 2026
@alexey-milovidov alexey-milovidov deleted the fix-02931-float-rounding branch March 23, 2026 01:09
Desel72 pushed a commit to Desel72/ClickHouse that referenced this pull request Mar 30, 2026
…rounding

Round Float64 results in test 02931_rewrite_sum_column_and_constant
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