1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! `ClickHouse` Native columnar block format -- the `format=Native` payload
//! encoding, independent of the transport that carries it.
//!
//! HOT PATH. Every row in and out of the server passes through here, so this
//! module is held to a 90% line-coverage target rather than the repo's 80%
//! floor, and every file in it meets that today. `docs/COVERAGE.md` carries
//! the numbers and how to measure them. Adding a wire format here means adding
//! the test with it, or the next reader inherits a claim that is no longer
//! true.
//!
//! Upstream's `src/rowbinary/` is row-oriented; this module is the columnar
//! primitive that lets the server write blocks into its merge tree without a
//! rows-to-columns transpose.
//!
//! # Module map
//!
//! - `columns`: type-name parser and the column reader that re-serialises
//! native cells as `RowBinary`.
//! - `encode`: INSERT-block encoder, shared by the HTTP and TCP transports.
//! - `decode`: SELECT-block decoder producing the typed column buffers
//! [`DecodedBlock`] carries.
//! - `sparse`: sparse-column wire format (offset list + non-default values).
//! - `io`: varint and length-prefixed-string helpers over
//! [`tokio::io::AsyncRead`]/[`tokio::io::AsyncWrite`] and [`bytes::BufMut`].
//!
//! The TCP transport in `src/tcp/` is a separate wire protocol that happens to
//! carry Native-format data blocks; HTTP carries the same blocks under
//! `format=Native`.
// The reader and decoder exist for the TCP transport; a build without it
// carries the codec with no in-tree caller. Scoped to that build so dead code
// still warns in the default one.
// Every name in this module's docs is a Rust or wire type, so the crate-root
// relaxation for README prose is reversed here.
// Private, like upstream's own `src/native/` keeps `BlockReader` and
// `BlockWriter`. The types a caller needs are re-exported below, so the
// module layout stays free to move without a breaking change.
pub
pub
pub
pub
pub
pub use ColumnType;
pub use ;
pub use ;