Skip to main content

Module numeric

Module numeric 

Source
Expand description

Numeric column types (integers, floats, bool). Numeric column implementations

ClickHouse Documentation:

§Integer Types

All integer types are stored in little-endian format:

TypeRust TypeStorageMinMax
Int8i81 byte-128127
Int16i162 bytes-32,76832,767
Int32i324 bytes-2³¹2³¹-1
Int64i648 bytes-2⁶³2⁶³-1
Int128i12816 bytes-2¹²⁷2¹²⁷-1
UInt8u81 byte0255
UInt16u162 bytes065,535
UInt32u324 bytes02³²-1
UInt64u648 bytes02⁶⁴-1
UInt128u12816 bytes02¹²⁸-1

§Floating-Point Types

IEEE 754 floating-point numbers, stored in little-endian:

  • Float32 - Single precision (32-bit)
  • Float64 - Double precision (64-bit)

§Bool Type

Bool is an alias for UInt8 where 0 = false, 1 = true.

Structs§

ColumnVector
Generic column for numeric types

Traits§

FixedSize
Trait for types that can be read/written as fixed-size values (synchronous version for columns)

Type Aliases§

ColumnDate
Column of Date values stored as u16 (days since 1970-01-01).
ColumnFloat32
Column of Float32 values (IEEE 754 single-precision, little-endian).
ColumnFloat64
Column of Float64 values (IEEE 754 double-precision, little-endian).
ColumnInt8
Column of Int8 values (1-byte signed integers).
ColumnInt16
Column of Int16 values (2-byte signed integers, little-endian).
ColumnInt32
Column of Int32 values (4-byte signed integers, little-endian).
ColumnInt64
Column of Int64 values (8-byte signed integers, little-endian).
ColumnInt128
Column of Int128 values (16-byte signed integers, little-endian).
ColumnUInt8
Column of UInt8 values (1-byte unsigned integers).
ColumnUInt16
Column of UInt16 values (2-byte unsigned integers, little-endian).
ColumnUInt32
Column of UInt32 values (4-byte unsigned integers, little-endian).
ColumnUInt64
Column of UInt64 values (8-byte unsigned integers, little-endian).
ColumnUInt128
Column of UInt128 values (16-byte unsigned integers, little-endian).