Skip to content

Commit

Permalink
Update protocol revision to 54454
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-sushko committed Jul 30, 2023
1 parent a50aa24 commit 7c2d8d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/Octonica.ClickHouseClient/ClickHouseTcpClient.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region License Apache 2.0
/* Copyright 2019-2021 Octonica
/* Copyright 2019-2021, 2023 Octonica
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -267,6 +267,9 @@ private void WriteTable(IClickHouseTableWriter table)
writer.WriteString(column.ColumnName);
writer.WriteString(column.ColumnType);

if (_client.ServerInfo.Revision >= ClickHouseProtocolRevisions.MinRevisionWithCustomSerialization)
writer.WriteBool(false); // has_custom

int rowCount = table.RowCount;
while (rowCount > 0)
{
Expand Down Expand Up @@ -358,6 +361,14 @@ public async ValueTask<BlockHeader> SkipTable(ServerDataMessage dataMessage, boo
{
var columnName = await reader.ReadString(async, cancellationToken);
var columnTypeName = await reader.ReadString(async, cancellationToken);

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

var columnType = _client._typeInfoProvider.GetTypeInfo(columnTypeName);
var columnInfo = new ColumnInfo(columnName, columnType);
columnInfos.Add(columnInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ public static class ClickHouseProtocolRevisions
/// <summary>
/// The number of the current revision. It is the latest revision supported by the client.
/// </summary>
public const int CurrentRevision = MinRevisionWithParallelReplicas;
public const int CurrentRevision = MinRevisionWithCustomSerialization;

/// <summary>
/// The number of protocol's revision with support of custom serialization.
/// </summary>
public const int MinRevisionWithCustomSerialization = 54454;

/// <summary>
/// The number of protocol's revision with support for parallel reading from replicas.
Expand Down

0 comments on commit 7c2d8d2

Please sign in to comment.