mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
better check of version for sparse serialization
This commit is contained in:
parent
525da38316
commit
aec0667f16
@ -44,6 +44,8 @@
|
|||||||
|
|
||||||
#define DBMS_MIN_PROTOCOL_VERSION_WITH_INCREMENTAL_PROFILE_EVENTS 54451
|
#define DBMS_MIN_PROTOCOL_VERSION_WITH_INCREMENTAL_PROFILE_EVENTS 54451
|
||||||
|
|
||||||
|
#define DBMS_MIN_REVISION_WITH_CUSTOM_SERIALIZATION 54454
|
||||||
|
|
||||||
#define DBMS_MIN_PROTOCOL_VERSION_WITH_INITIAL_QUERY_START_TIME 54449
|
#define DBMS_MIN_PROTOCOL_VERSION_WITH_INITIAL_QUERY_START_TIME 54449
|
||||||
|
|
||||||
#define DBMS_MIN_PROTOCOL_VERSION_WITH_PROFILE_EVENTS_IN_INSERT 54456
|
#define DBMS_MIN_PROTOCOL_VERSION_WITH_PROFILE_EVENTS_IN_INSERT 54456
|
||||||
|
@ -173,7 +173,7 @@ Block NativeReader::read()
|
|||||||
setVersionToAggregateFunctions(column.type, true, server_revision);
|
setVersionToAggregateFunctions(column.type, true, server_revision);
|
||||||
|
|
||||||
SerializationPtr serialization;
|
SerializationPtr serialization;
|
||||||
if (server_revision >= DBMS_MIN_REVISION_WITH_SPARSE_SERIALIZATION)
|
if (server_revision >= DBMS_MIN_REVISION_WITH_CUSTOM_SERIALIZATION)
|
||||||
{
|
{
|
||||||
auto info = column.type->createSerializationInfo({});
|
auto info = column.type->createSerializationInfo({});
|
||||||
|
|
||||||
|
@ -132,12 +132,22 @@ size_t NativeWriter::write(const Block & block)
|
|||||||
|
|
||||||
/// Serialization. Dynamic, if client supports it.
|
/// Serialization. Dynamic, if client supports it.
|
||||||
SerializationPtr serialization;
|
SerializationPtr serialization;
|
||||||
if (client_revision >= DBMS_MIN_REVISION_WITH_SPARSE_SERIALIZATION)
|
if (client_revision >= DBMS_MIN_REVISION_WITH_CUSTOM_SERIALIZATION)
|
||||||
{
|
{
|
||||||
auto info = column.type->getSerializationInfo(*column.column);
|
auto info = column.type->getSerializationInfo(*column.column);
|
||||||
serialization = column.type->getSerialization(*info);
|
bool has_custom = false;
|
||||||
|
|
||||||
|
if (client_revision >= DBMS_MIN_REVISION_WITH_SPARSE_SERIALIZATION)
|
||||||
|
{
|
||||||
|
serialization = column.type->getSerialization(*info);
|
||||||
|
has_custom = info->hasCustomSerialization();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
serialization = column.type->getDefaultSerialization();
|
||||||
|
column.column = recursiveRemoveSparse(column.column);
|
||||||
|
}
|
||||||
|
|
||||||
bool has_custom = info->hasCustomSerialization();
|
|
||||||
writeBinary(static_cast<UInt8>(has_custom), ostr);
|
writeBinary(static_cast<UInt8>(has_custom), ostr);
|
||||||
if (has_custom)
|
if (has_custom)
|
||||||
info->serialializeKindBinary(ostr);
|
info->serialializeKindBinary(ostr);
|
||||||
|
Loading…
Reference in New Issue
Block a user