Octonica / ClickHouseClient

ClickHouse .NET Core driver
Apache License 2.0
138 stars 23 forks source link

TODO: add support for custom serialization exception when read bool column type #85

Closed DevDmitryN closed 6 months ago

DevDmitryN commented 6 months ago

I try read bool column type, but get NotImplementedException "TODO: add support for custom serialization.". In same time nullable bool column type works fine.

Can you solve this problem?

FROM YOUR SOURCE CODE:

ClickHouseTcpClient row 421

if (_client.ServerInfo.Revision >= ClickHouseProtocolRevisions.MinRevisionWithCustomSerialization)
{
     var hasCustom = await reader.ReadBool(async, cancellationToken);
      if (hasCustom)
          throw new NotImplementedException("TODO: add support for custom serialization.");
}

PS: clickhouse version 24.1.5.6

alec-anikin commented 6 months ago

It's sparse column serialization which was enabled by default in v23.7+ As a workaround, you can disable it on the server: see more about merge tree option ratio_of_defaults_for_sparse_serialization

valeravorobjev commented 6 months ago

Not only a Boolean value. I've got an integer column with zero value (0) or column array of integers. And I get this error in both cases. Yes, setting the value of ratio_of_defaults_for_sparse_serialization=1.0 helps me when creating a table, but this is a bad way to solve the problem

Clickhouse latest version

SergeyMirvoda commented 6 months ago

but this is a bad way to solve the problem

sure, we will fix this ASAP

victor-sushko commented 6 months ago

The bug was fixed in the version 3.1.2.

Yerkon commented 6 months ago

@victor-sushko, Is any change log will be added to see changes, improvements, some breaking list? Is it safe to upgrade for the latest version ?

victor-sushko commented 6 months ago

Is any change log will be added to see changes, improvements, some breaking list?

I updated the changelog, but have not merged it to the main branch yet. https://github.com/Octonica/ClickHouseClient/blob/v3.1.2/CHANGELOG.md

Is it safe to upgrade for the latest version ?

Yes, it should be safe. There were mostly additions for the sparse serialization mode.