Skip to content

SHA256 add FixedString support#11878

Merged
alexey-milovidov merged 2 commits intoClickHouse:masterfrom
ucasfl:sha256
Jun 23, 2020
Merged

SHA256 add FixedString support#11878
alexey-milovidov merged 2 commits intoClickHouse:masterfrom
ucasfl:sha256

Conversation

@ucasfl
Copy link
Copy Markdown
Collaborator

@ucasfl ucasfl commented Jun 23, 2020

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):

Add FixedString support in Hashing functions.

Detailed description / Documentation draft:

...

By adding documentation, you'll allow users to try your new feature immediately, not when someone else will have time to document it later. Documentation is necessary for all features that affect user experience in any way. You can add brief documentation draft above, or add documentation right into your patch as Markdown files in docs folder.

If you are doing this for the first time, it's recommended to read the lightweight Contributing to ClickHouse Documentation guide first.

@blinkov blinkov added the pr-improvement Pull request with some product improvements label Jun 23, 2020
@qoega
Copy link
Copy Markdown
Member

qoega commented Jun 23, 2020

Can you add relevant test cases?

@qoega qoega self-assigned this Jun 23, 2020
Comment on lines 10 to 19
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT randomFixedString(20);
INSERT INTO defaults SELECT s
FROM generateRandom('s FixedString(20)', 1, 1, 1)
LIMIT 20

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

randomFixedString is not stable between different calls. You can use predefined seed in generateRandom instead.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i will change it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SELECT SHA256(s) FROM defaults;
SELECT hex(SHA256(s)) FROM defaults;

@ucasfl ucasfl force-pushed the sha256 branch 2 times, most recently from 6efb8d0 to e72f943 Compare June 23, 2020 11:51
fix

fix

fix
@alexey-milovidov alexey-milovidov merged commit be14b42 into ClickHouse:master Jun 23, 2020
@ucasfl ucasfl deleted the sha256 branch July 2, 2020 08:50
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.

4 participants