Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/source/format/Columnar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,9 @@ The complete serialized message must be a multiple of 8 bytes so that messages
can be relocated between streams. Otherwise the amount of padding between the
metadata and the message body could be non-deterministic.

The ``metadata_size`` includes the size of the ``Message`` plus
padding. The ``metadata_flatbuffer`` contains a Flatbuffers-serialized
The ``metadata_size`` includes the size of the ``Message`` flatbuffer plus
padding, but excludes the continuation indicator and the metadata length prefix.
The ``metadata_flatbuffer`` contains a Flatbuffers-serialized
``Message`` value, which internally includes:

* A version number
Expand Down Expand Up @@ -1531,6 +1532,15 @@ sizes for each of the data blocks in the file. This enables random access to
any record batch in the file. See `File.fbs`_ for the precise details of the
file footer.

Each ``Block`` in the footer describes a dictionary or record batch IPC message.
Its ``offset`` points to the start of the encapsulated IPC message, including
the continuation indicator and metadata length prefix. Its ``metaDataLength``
includes that prefix, the ``Message`` flatbuffer, and padding, so the message
body starts at ``offset + metaDataLength``. Thus, ``metaDataLength`` is
``8 + metadata_size`` for the encapsulated message format described above,
rather than ``metadata_size`` alone. For the legacy format without a continuation
indicator, the prefix is 4 bytes and ``metaDataLength`` is ``4 + metadata_size``.

Schematically we have: ::

<magic number "ARROW1">
Expand Down
7 changes: 5 additions & 2 deletions format/File.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ table Footer {

struct Block {

/// Index to the start of the RecordBatch (note this is past the Message header)
/// Byte offset to the start of the encapsulated IPC message, including its
/// continuation indicator (if present) and metadata length prefix.
offset: long;

/// Length of the metadata
/// Length of the encapsulated IPC message metadata, including the continuation
/// indicator (if present), metadata length prefix, Message flatbuffer, and
/// padding. This is the byte distance from offset to the start of the body.
metaDataLength: int;

/// Length of the data (this is aligned so there can be a gap between this and
Expand Down
Loading