Skip to content

Document NaN bit-pattern handling in set semantics - #105787

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/docs-nan-set-semantics-105748
May 25, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/docs-nan-set-semantics-105748

Conversation

@groeneai

@groeneai groeneai commented May 25, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to discussion on #105756 (closed in favor of a docs-only path
per @Algunenano's review). Closes #105748.

Adds a section to docs/en/sql-reference/data-types/float.md explaining
that hash tables compare keys byte-wise, so different NaN bit patterns
(e.g. 0./0. vs literal nan vs ARM NEON log(-1.) after #98230) are
treated as distinct by DISTINCT, GROUP BY, uniqExact,
countDistinct, and equi-JOIN on a Float key. Shows two
canonicalization patterns users can apply when they need NaN-equal set
semantics.

Changelog category (leave one):

  • Documentation (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)

Version info

  • Merged into: 26.6.1.132

Adds a section to the Float types reference page explaining why
different NaN values can be treated as distinct by DISTINCT, GROUP BY,
uniqExact, countDistinct, and equi-JOIN on Float keys, and how to
canonicalize them in user queries.

Follow-up to discussion on ClickHouse#105756 (closed in favor of docs-only path).
Closes ClickHouse#105748.
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @Algunenano - this is the docs-only PR you agreed to on #105756. Adds a section to the Float types reference page explaining the byte-wise hash NaN split and shows two canonicalization patterns users can apply when they need NaN-equal set semantics.

@Algunenano Algunenano self-assigned this May 25, 2026
@Algunenano Algunenano added the can be tested Allows running workflows for external contributors label May 25, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c83d9a7]

Summary: ✅


AI Review

Summary

This PR adds documentation to docs/en/sql-reference/data-types/float.md describing NaN bit-pattern behavior in set-semantics operations and giving canonicalization patterns for users who need NaN-equal semantics. I reviewed the current diff and prior PR discussion and found no unresolved correctness, safety, performance, or PR-metadata issues.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-documentation Documentation PRs for the specific code PR label May 25, 2026
@Algunenano
Algunenano added this pull request to the merge queue May 25, 2026
Merged via the queue into ClickHouse:master with commit 3de9e9c May 25, 2026
166 checks passed
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 25, 2026
DavidHe-2008 pushed a commit to DavidHe-2008/ClickHouse that referenced this pull request Jun 1, 2026
…set-semantics-105748

Document NaN bit-pattern handling in set semantics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-documentation Documentation PRs for the specific code PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DISTINCT does not deduplicate NaN on AArch64 (regression from #98230, fastops on ARM)

3 participants