Skip to content

Check hash function at table creation#26256

Merged
CurtizJ merged 6 commits intoClickHouse:masterfrom
zxc111:issue-822
Jul 14, 2021
Merged

Check hash function at table creation#26256
CurtizJ merged 6 commits intoClickHouse:masterfrom
zxc111:issue-822

Conversation

@zxc111
Copy link
Copy Markdown
Contributor

@zxc111 zxc111 commented Jul 12, 2021

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Check hash function at table creation, not at sampling.
Add settings in MergeTreeSettings, if someone create a table with incorrect sampling column but sampling never be used, disable this settings for starting the server without exception.

closes #822

@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Jul 12, 2021
@CurtizJ CurtizJ self-assigned this Jul 13, 2021
@CurtizJ
Copy link
Copy Markdown
Member

CurtizJ commented Jul 13, 2021

@zxc111 It's better not to explicitly create database in functional tests. Instead clickhouse-test script creates a database with random name before run and uses it as default database for queries.

@CurtizJ CurtizJ merged commit e2249bf into ClickHouse:master Jul 14, 2021
@gyuton
Copy link
Copy Markdown
Contributor

gyuton commented Jul 15, 2021

Internal documentation ticket: DOCSUP-11657.

macobo added a commit to PostHog/posthog that referenced this pull request Aug 23, 2021
This was "broken" upsteam in 21.7 in
ClickHouse/ClickHouse#822 /
ClickHouse/ClickHouse#26256

In reality if we ever tried to use SAMPLE BY it would just have failed
due to the wrong column.

Fixed by hashing the UUID for sampling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hash functions should be checked at table creation, not at sampling time

5 participants