Expand description
Row serialization for disk spilling
This module provides compact binary serialization for rows and sort keys, optimized for external sort and aggregate operations.
§Format
Each row is serialized as:
[num_values: u16] [value1] [value2] ... [valueN]Each value is serialized as:
[type_tag: u8] [data...]§Design Decisions
- No length prefix for entire row: We write rows sequentially and read them back in chunks, so we don’t need random access within a run.
- Compact type tags: Single byte discriminant for common types
- Little-endian: Matches most modern hardware for zero-copy potential
Functions§
- deserialize_
row - Deserialize a row from the reader
- deserialize_
row_ with_ keys - Deserialize a row with its sort keys
- deserialize_
value - Deserialize a single SqlValue from the reader
- estimate_
serialized_ size - Estimate the serialized size of a row in bytes
- serialize_
row - Serialize a row to the writer
- serialize_
row_ with_ keys - Serialize a row with its sort keys
- serialize_
value - Serialize a single SqlValue to the writer