Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Given a set of user-defined columns, this set is then rearranged so that fixed-sized columns go first. This sorted set of columns is used to form a row. Row layout is as follows:

Field

Size / Comments

Schema version2 bytes. Short number:
positive - regular row: key  and value chunks are present
0 - no value. If the flag is set, the value chunk is omitted, e.g. the row represents a tombstone or key-row to lookup by the key,
Key columns hash4 bytes
Key chunk:
Key chunk size
4 bytes
Flags1 byte
Variable-length columns offsets table size2 bytes
Variable-length columns offsets tableVariable (number of non-null varlen columns * 4<format_size>)
Fix-sized columns valuesVariable
Variable-length columns valuesVariable
Value chunk:
Value chunk size4 bytes
Flags1 byte
Null-map
  • (number of columns / 8) bytes - If the value columns contains nullable column;
  • 0 bytes - otherwise
Variable-length  columns offsets table size2 bytes
Variable-length  columns offsets tableVariable (number of non-null varlen columns * 4<format_size>)
Fix-sized columns valuesVariable
Variable-length columns valuesVariable

...

Flags BitsDescription
0, 1

VarTable formats:

  • (0, 0) - SKIPPED.  VarTable for chunk is omitted  (all column values in the chunk either of fix-sized type or null);
  • (0, 1) - TINY format (1 byte for offset), format_size = 1;
  • (1, 0) - MEDIUM format (2 bytes for offset), format_size = 2;
  • (1, 1) - LARGE format (4 bytes for offset), format_size = 4
2-7Reserverd


Hash calculation and key comparison

...