Skip to content

Decimal persistence round trip through IPC and parquet - #3

Merged
pbower merged 2 commits into
mainfrom
SC-EPC98-DECIMAL-TSK463-LIGHTSTREAM-IPC
Sep 9, 2026
Merged

Decimal persistence round trip through IPC and parquet#3
pbower merged 2 commits into
mainfrom
SC-EPC98-DECIMAL-TSK463-LIGHTSTREAM-IPC

Conversation

@pbower

@pbower pbower commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add decimal feature to lightstream forwarding to minarrow/decimal
  • IPC writer encodes Decimal32, Decimal64 and Decimal128 columns with precision, scale and bitWidth in the schema and storage buffers in record batches
  • IPC decoder reconstructs DecimalArray from the schema's precision/scale and the storage buffer for both Arc-based and SharedBuffer paths
  • Windowed reads carry precision and scale through to the sub-slice
  • CSV encoder renders decimal values at the correct scale
  • Parquet type mapping covers the three widths

Test plan

  • IPC file round-trip with all three widths, nulls, precision and scale assertions
  • IPC stream round-trip in-memory
  • Windowed read at offset 512 of a 1024-row table
  • Multi-batch write and read
  • CSV rendering at scale, zero scale, and null handling
  • Parquet type mapping for all three widths

Add a `decimal` feature that carries DecimalArray columns (Decimal32,
Decimal64, Decimal128) through the full IPC persistence path: schema
encoding, record batch write, IPC read (both streaming and file
protocols), windowed read, CSV rendering, and parquet type mapping.

Each decimal width stores its unscaled integer values in the IPC body
alongside its precision and scale in the schema's Decimal flatbuffer
type (tag 7). The reader reconstructs the DecimalArray with the
original precision, scale, storage values and null mask.

Tests cover write, full read, windowed read, multi-batch write,
stream round-trip, CSV scaled-value output, and parquet physical/
logical type mapping for all three widths with nulls.
@pbower
pbower merged commit 6bf15a0 into main Sep 9, 2026
19 checks passed
@pbower
pbower deleted the SC-EPC98-DECIMAL-TSK463-LIGHTSTREAM-IPC branch September 9, 2026 01:09
@pbower pbower changed the title Decimal persistence round trip through IPC and parquet (TSK463) Decimal persistence round trip through IPC and parquet Sep 9, 2026
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.

1 participant