Skip to content

feat: Add custom metadata support for IPC messages and RecordBatch#361

Merged
kou merged 4 commits into
apache:mainfrom
Query-farm:feat_recordbatch_metadata
Feb 21, 2026
Merged

feat: Add custom metadata support for IPC messages and RecordBatch#361
kou merged 4 commits into
apache:mainfrom
Query-farm:feat_recordbatch_metadata

Conversation

@rustyconover

@rustyconover rustyconover commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

What's Changed

Decode and expose custom metadata from IPC message headers, propagating it through the reader to RecordBatch instances. This allows accessing per-batch metadata stored in Arrow IPC streams and files.

Extend RecordBatchWriter to support writing custom metadata to IPC messages, similar to PyArrow's write_batch(batch, custom_metadata=...).

Changes:

  • Update Message.from() to accept optional metadata parameter
  • Update Message.encode() to serialize custom metadata to FlatBuffers
  • Add customMetadata parameter to RecordBatchWriter.write()
  • Add mergeMetadata() helper that combines batch.metadata with the
    parameter (parameter takes precedence for duplicate keys)
  • Add comprehensive integration tests for write/read round-trip

Usage:
writer.write(batch, new Map([['key', 'value']]));

Decode and expose custom metadata from IPC message headers, propagating
it through the reader to RecordBatch instances. This allows accessing
per-batch metadata stored in Arrow IPC streams and files.
Extend RecordBatchWriter to support writing custom metadata to IPC
messages, similar to PyArrow's write_batch(batch, custom_metadata=...).

Changes:
  - Update Message.from() to accept optional metadata parameter
  - Update Message.encode() to serialize custom metadata to FlatBuffers
  - Add customMetadata parameter to RecordBatchWriter.write()
  - Add mergeMetadata() helper that combines batch.metadata with the
    parameter (parameter takes precedence for duplicate keys)
  - Add comprehensive integration tests for write/read round-trip

Usage:
  writer.write(batch, new Map([['key', 'value']]));
@amoeba
amoeba requested review from domoritz and trxcllnt January 14, 2026 17:12

@trxcllnt trxcllnt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, just a few questions about the writer API.

Comment thread src/ipc/metadata/message.ts Outdated
Comment thread src/ipc/metadata/message.ts Outdated
Comment thread src/ipc/writer.ts
Comment thread test/unit/ipc/writer/message-metadata-tests.ts Outdated
@rustyconover

Copy link
Copy Markdown
Contributor Author

@trxcllnt I think this should be good to go, do you need any more changes?

@trxcllnt trxcllnt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, looks good to me!

@kou
kou merged commit f203cfb into apache:main Feb 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants