Versions Compared

Key

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

...

  1. Header;
  2. Nullmap;
  3. Offset table;
  4. Value area.

Header.

It contains only flags in 1 byte.

Bits 0-1: Size class of the variable-length area.

Bit 2: Set if the nullmap is present.

Size class encodes the number of bytes used for entries in the offset table. It is encoded like this:

0b00 - 1 bytes

0b01 - 2 bytes

0b10 - 4 bytes

0b11 - 8 bytes

So the entry size can be calculated as follows:

Size = 1 << (flags & 0b11)

By the way, the last option works fine for C++ and possibly other languages but for Java it will be hard to support, so it might be excluded.

Nullmap

If a schema has nullable columns then the corresponding tuple may contain a nullmap. The nullmap may be skipped if there are no actual NULL values in a given tuple instance.

Nullmap is a bitset that contains `N` bits, occupies `(N + 7) / 8` bytes, where `N` is the number of columns in the schema.

In the bitset every bit set to `1` means that the respective field is NULL.


Reference Links

1. IEP-54: Schema-first Approach

...