Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(UBSan): convertion NaN to unsigned int in Reservoir Sampler #43103

Closed
wants to merge 5 commits into from

Conversation

devcrafter
Copy link
Member

@devcrafter devcrafter commented Nov 9, 2022

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Fixes #42978

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 9, 2022
@devcrafter devcrafter marked this pull request as draft November 9, 2022 22:36
@devcrafter devcrafter force-pushed the fix_quantile_covertion_nan_to_int branch from d527134 to 31c3f87 Compare November 9, 2022 22:44
@devcrafter
Copy link
Member Author

The fix is changing current behavior for empty column

CREATE TABLE default.quantile
(
    `a` UInt32
)
ENGINE = MergeTree
ORDER BY tuple()

Current:

SELECT median(a)
FROM quantile
    WITH TOTALS

Query id: 7d7341c8-e7c0-4365-b5b2-f3bafa100324

┌─median(a)─┐
│       nan │
└───────────┘

Totals:
┌─median(a)─┐
│       nan │
└───────────┘

New:

SELECT median(a)
FROM quantile
    WITH TOTALS

Query id: 7d7341c8-e7c0-4365-b5b2-f3bafa100324

┌─median(a)─┐
│       0   │
└───────────┘

Totals:
┌─median(a)─┐
│       0   │
└───────────┘

@devcrafter
Copy link
Member Author

fixed in #44067

@devcrafter devcrafter closed this Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-not-for-changelog This PR should not be mentioned in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AST fuzzer (ubsan): nan is outside the range of representable values of type 'unsigned int'
2 participants