Skip to main content
Version: dev

Compact Row

Compact Row is a Java-only row encoding that reduces fixed-slot and null-bitmap overhead. It is not wire-compatible with Standard Row.

Create a compact encoder

RowEncoder<MyBean> encoder =
Encoders.buildBeanCodec(MyBean.class)
.compactEncoding()
.build()
.get();

BinaryRow row = encoder.toRow(value);
MyBean decoded = encoder.fromRow(row);

Reuse the encoder within one thread. Create separate encoders for concurrent threads.

Layout tradeoffs

  • Fixed-size fields use their natural widths instead of eight-byte Standard Row slots.
  • Fields are sorted by alignment to reduce padding.
  • The null bitmap is omitted when no field is nullable.
  • Fixed-size nested structs can be stored inline.

Choose Compact Row only when every reader is Java and the space reduction justifies the Java-specific layout. Use Standard Row for Java/Python/C++/Rust interchange.

See the Row Format specification for the exact binary layout.