Skip to content

feat: switch to writeNominalColumnarBatches endpoint#210

Open
gregakinman wants to merge 2 commits intomainfrom
gregakinman/columnar-endpoint
Open

feat: switch to writeNominalColumnarBatches endpoint#210
gregakinman wants to merge 2 commits intomainfrom
gregakinman/columnar-endpoint

Conversation

@gregakinman
Copy link

Summary

  • Switches from the row-oriented writeNominalBatches endpoint (POST /storage/writer/v1/nominal/{dataSourceRid}) to the new columnar writeNominalColumnarBatches endpoint (POST /storage/writer/v1/nominal-columnar)
  • The columnar format stores timestamps and values as separate packed arrays per channel, enabling better compression and lower latency
  • data_source_rid is now included in the protobuf body rather than as a URL path parameter
  • Internal buffer still uses row-oriented point types; conversion to columnar happens at serialization time in SeriesBuffer::take()

Changes

  • client.rs: Updated endpoint path, removed data_source_rid path parameter
  • consumer.rs: WriteRequestConsumer trait now operates on WriteBatchesRequest (columnar); NominalCoreConsumer sets data_source_rid in the proto body before encoding; AvroFileConsumer updated for columnar format
  • stream.rs: Added points_type_to_columnar() conversion function; SeriesBuffer::take() now produces Vec<RecordsBatch>; batch_processor() creates WriteBatchesRequest
  • listener.rs: NominalStreamListener trait uses WriteBatchesRequest
  • lib.rs: Updated prelude exports and all integration tests for columnar format

Test plan

  • All 6 existing tests pass with columnar format
  • cargo clippy is clean
  • Manual integration testing against staging/production environment

🤖 Generated with Claude Code

Switch from the row-oriented writeNominalBatches endpoint to the new
columnar writeNominalColumnarBatches endpoint for better compression
and performance. The columnar format uses separate timestamp arrays
and packed value arrays per channel instead of per-point timestamps.

Key changes:
- client.rs: POST to /storage/writer/v1/nominal-columnar (no path param)
- consumer.rs: WriteRequestConsumer trait now uses WriteBatchesRequest
- stream.rs: SeriesBuffer::take() converts row-oriented PointsType to
  columnar RecordsBatch with separate timestamps and packed values
- listener.rs: NominalStreamListener uses WriteBatchesRequest
- data_source_rid is now in the proto body, not the URL path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alxhill alxhill self-requested a review February 25, 2026 22:26
@alxhill
Copy link
Contributor

alxhill commented Feb 26, 2026

overall, tested this and it works well and works faster too.

it is a break from the perspective of a user of the library, if they write their own WriteConsumers. Connect does this, but we can move to something else - will check with customers too.

open question if we should do a bigger refactor to construct the columnar format directly

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.

2 participants