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

LowCardinality(Nullable(String)) doesn't work #121

Open
Tjon92 opened this issue Mar 25, 2021 · 3 comments
Open

LowCardinality(Nullable(String)) doesn't work #121

Tjon92 opened this issue Mar 25, 2021 · 3 comments

Comments

@Tjon92
Copy link

Tjon92 commented Mar 25, 2021

Description

Если в запросе присутствует поле с типом LowCardinality(Nullable(String)), то запрос просто зависает

Steps to reproduce

Использую для запросов конструкции из ваших примеров и до использования полей LowCardinality(Nullable(String)) всё работало отлично. Теперь же происходит просто зависание. Причем сначала отжирается резко несколько гигов оперативки.

Не работает ни такая конструкция:

do
{
while (reader.Read())
{
}
} while (reader.NextResult());

Ни такая:

                    reader.ReadAll(r =>
                    {
                        result.Add(reader.GetString(0));
                    });
@killwort
Copy link
Owner

killwort commented Aug 9, 2021

Можно более конкретный пример?
Нужна структура таблицы, нужен SQL запрос который виснет.

@sandeeppnaik
Copy link

sandeeppnaik commented Feb 22, 2023

Running into the same problem. I had a column of Nullable(String) type. When I changed the column to LowCardinality(Nullable(String)), I get the following error

System.InvalidOperationException: Received unknown packet type Hello from server.    at ClickHouse.Ado.Impl.ProtocolFormatter.ReadPacket(Response rv)    at 
ClickHouse.Ado.Impl.ProtocolFormatter.ReadResponse()    at ClickHouse.Ado.ClickHouseDataReader.Close()    at ClickHouse.Ado.ClickHouseDataReader.Dispose()
--

@killwort
Copy link
Owner

Looks like support for LowCardinality<Nullable> is completely broken in clickhouse itself.
https://www.tinybird.co/blog-posts/tips-10-null-behavior-with-lowcardinality-columns
ClickHouse/ClickHouse#8406

I've implemented reading and writing of these types without regard to NULLs as they state in the docs, yet it sometimes eat up the first value on insert. Reads are OK though.

For now I think that's sufficient, I don't really understand the need to keep NULL and '' values distinct whilst saying it has 'low cardinality'.

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

No branches or pull requests

3 participants