Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix of LowCardinality bug: empty string converted to other value on INSERT #53

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

Merged
merged 2 commits into from
Sep 25, 2020

Conversation

Enmk
Copy link
Contributor

@Enmk Enmk commented Sep 24, 2020

Fix of empty string becoming a first non-empty string of ColumnLowCardinality;
Added some tests to make sure that doesn't happen again.

@@ -365,7 +365,7 @@ void ColumnLowCardinality::AppendNullItemToEmptyColumn()

const auto null_item = GetNullItemForDictionary(dictionary_column_);
AppendToDictionary(*dictionary_column_, null_item);
unique_items_map_.emplace(computeHashKey(null_item), dictionary_column_->Size());
unique_items_map_.emplace(computeHashKey(null_item), 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here it is, where the bug was introduced (by me)

@Enmk Enmk force-pushed the fix_LowCardinality_Empty_value branch from 31965cd to 551bdf6 Compare September 24, 2020 11:49
Copy link
Contributor

@traceon traceon left a comment

Choose a reason for hiding this comment

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

LGTM

@traceon traceon merged commit 04a4dce into ClickHouse:master Sep 25, 2020
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.

2 participants