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 bug in ColumnLowCardinality::Load #270

Merged
merged 1 commit into from
Dec 19, 2022
Merged

Conversation

den818
Copy link
Contributor

@den818 den818 commented Dec 18, 2022

ColumnLowCardinality::Load allocate the wrong amount rows for LowCardinality(Nullable(X)) columns. In most cases, it leads to extra memory allocation than required. But in case then the number of rows in a column is less than the dictionary size exception "can't load column 'some column' of type LowCardinality(Nullable(X))" happened. The dictionary always contains null and default values. So if the column contains every unique value once and doesn't contain a null or default value, then such a situation happens.

@Enmk Enmk merged commit d03dbfe into ClickHouse:master Dec 19, 2022
@den818 den818 deleted the LC-bug branch December 19, 2022 10:58
@huyphams
Copy link
Contributor

I'm still getting this issue, using the latest commit d03dbfe

Run this query:

SELECT * FROM "system"."session_log" LIMIT 300 OFFSET 0;

Error message:
can't load column 'roles' of type Array(LowCardinality(String))

Server version: ClickHouse 21.12.3.32

@den818
Copy link
Contributor Author

den818 commented Dec 22, 2022

Hi huyphams

It is another bug. It will be fixed in PR

#272

@huyphams
Copy link
Contributor

Thanks @den818

@huyphams
Copy link
Contributor

I confirmed it works @den818 thank you so much.

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.

3 participants