arrow_row::variable

Function encode

source
pub fn encode<'a, I: Iterator<Item = Option<&'a [u8]>>>(
    data: &mut [u8],
    offsets: &mut [usize],
    i: I,
    opts: SortOptions,
)
Expand description

Variable length values are encoded as

  • single 0_u8 if null
  • single 1_u8 if empty array
  • 2_u8 if not empty, followed by one or more blocks

where a block is encoded as

  • BLOCK_SIZE bytes of string data, padded with 0s
  • 0xFF_u8 if this is not the last block for this string
  • otherwise the length of the block as a u8