Column stats
Each block record in the block stats frame ends with ncols column stats, one per column of the block, in column order. The encoding is the same in stats revision 1 and revision 2.
Layout
Section titled “Layout”| Field | Encoding | Meaning |
|---|---|---|
flags |
u8 | Which bounds follow, see below |
present |
varint | Cells present |
nulls |
varint | Null cells |
nans |
varint | NaN cells |
| ints bounds | zvarint lo, zvarint hi, only with flag 0x01 |
Integer min and max |
| floats bounds | f64 lo, f64 hi (LE bits), only with flag 0x02 |
Float min and max |
| bools bounds | u8, only with flag 0x04 | bit 0 = min, bit 1 = max |
| bytes bounds | varint length (at most 64) and bytes for min, then the same for max, only with flag 0x08 | Bytes min and max, each at most 64 bytes |
| Flag | Meaning |
|---|---|
| 0x01 | ints bounds present |
| 0x02 | floats bounds present |
| 0x04 | bools bounds present |
| 0x08 | bytes bounds present |
| 0x10 | the bytes maximum was truncated |
A flags byte of 0x20 or above is Corrupt.
Truncated maximum
Section titled “Truncated maximum”Bytes bounds are limited to 64 bytes. Flag 0x10 marks that the maximum was cut to fit.
rows counts the entries summarised per column. opaque counts the puts that were not summarised. When it is not zero the stats prove nothing about values and may_match is true. A reader may turn these bounds into zone maps.