ch_connect 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,8 +12,10 @@
12
12
  * ZSTD wrapper (chc_zstd_codec_init) is compiled in by default & pulls
13
13
  * <zstd.h>; link -lzstd. Define CHC_NO_ZSTD before including to opt out.
14
14
  *
15
- * Frame layout (matches ClickHouse server / clickhouse-cpp
16
- * base/compressed.cpp):
15
+ * Frame layout per the Native Format spec:
16
+ * clickhouse.com/docs/reference/interfaces/specs/NativeFormat#compression-frame
17
+ *
18
+ * checksum covers everything from offset 16 (method + sizes + payload).
17
19
  *
18
20
  * [ 16 B CityHash128 of the rest of the frame ]
19
21
  * [ 1 B method (0x82 LZ4, 0x90 ZSTD, 0x02 none) ]
@@ -77,12 +79,13 @@ struct chc_codec {
77
79
  size_t (*zstd_bound)(size_t src_len);
78
80
  };
79
81
 
80
- /* Default chunk size for outgoing frames (matches clickhouse-cpp). */
82
+ /* Default chunk size for outgoing frames. The Native Format spec bounds
83
+ * a frame at 1 GiB; we stay well under it at 64 KiB. */
81
84
  #define CHC_COMPRESS_MAX_CHUNK 65535u
82
85
 
83
86
  /* Internal-but-exported: 128-bit CityHash. Returned as the two 64-bit
84
87
  * halves the wire-format encodes (lo first, hi second). Frozen variant
85
- * matching CH server / clickhouse-cpp. */
88
+ * the server uses. */
86
89
  void chc_cityhash128(const void *data, size_t len,
87
90
  uint64_t *out_lo, uint64_t *out_hi);
88
91
 
@@ -106,7 +109,7 @@ void chc_zstd_codec_init(chc_codec *out);
106
109
 
107
110
  /* ============================================================
108
111
  * CityHash128 (frozen v1.0.3 variant, ported from city.cc).
109
- * Original: Copyright (c) 2011 Google, Inc. (MIT licence).
112
+ * Original: Copyright (c) 2011 Google, Inc. (MIT license).
110
113
  * Short-string helpers live in clickhouse.h; this block layers
111
114
  * the 128-bit driver on top.
112
115
  * ============================================================ */