Skip to content

Commit c1bf280

Browse files
authored
Merge pull request #223 from den818/COLUMN_DEFAULTS_METADATA
Receiving columns metadata
2 parents 8cce67d + 51ea715 commit c1bf280

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

clickhouse/client.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
#define DBMS_MIN_REVISION_WITH_SERVER_DISPLAY_NAME 54372
3535
#define DBMS_MIN_REVISION_WITH_VERSION_PATCH 54401
3636
#define DBMS_MIN_REVISION_WITH_LOW_CARDINALITY_TYPE 54405
37+
#define DBMS_MIN_REVISION_WITH_COLUMN_DEFAULTS_METADATA 54410
3738

38-
#define REVISION DBMS_MIN_REVISION_WITH_LOW_CARDINALITY_TYPE
39+
#define REVISION DBMS_MIN_REVISION_WITH_COLUMN_DEFAULTS_METADATA
3940

4041
namespace clickhouse {
4142

@@ -430,6 +431,19 @@ bool Client::Impl::ReceivePacket(uint64_t* server_packet) {
430431
return false;
431432
}
432433

434+
case ServerCodes::TableColumns: {
435+
// external table name
436+
if (!WireFormat::SkipString(*input_)) {
437+
return false;
438+
}
439+
440+
// columns metadata
441+
if (!WireFormat::SkipString(*input_)) {
442+
return false;
443+
}
444+
return true;
445+
}
446+
433447
default:
434448
throw UnimplementedError("unimplemented " + std::to_string((int)packet_type));
435449
break;

clickhouse/protocol.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ namespace clickhouse {
1616
Extremes = 8, /// Block of mins and maxs, may be compressed.
1717
TablesStatusResponse = 9, /// Response to TableStatus.
1818
Log = 10, /// Query execution log.
19+
TableColumns = 11, /// Columns' description for default values calculation
1920
};
2021
}
2122

2223
/// Types of packets sent by client.
2324
namespace ClientCodes {
2425
enum {
2526
Hello = 0, /// Name, version, default database name.
26-
Query = 1, /** Query id, query settings, query processing stage,
27+
Query = 1, /** Query id, query settings, query processing stage,
2728
* compression status, and query text (no INSERT data).
2829
*/
2930
Data = 2, /// Data `Block` (e.g. INSERT data), may be compressed.
@@ -32,7 +33,7 @@ namespace clickhouse {
3233
};
3334
}
3435

35-
/// Should we compress `Block`s of data
36+
/// Should we compress `Block`s of data
3637
namespace CompressionState {
3738
enum {
3839
Disable = 0,

0 commit comments

Comments
 (0)