Skip to content

fix(ingest): prevent panic during high-concurrency writes with schema…#137

Merged
xe-nvdk merged 1 commit intomainfrom
fix/arrow-writer-sparse-columns-panic
Jan 19, 2026
Merged

fix(ingest): prevent panic during high-concurrency writes with schema…#137
xe-nvdk merged 1 commit intomainfrom
fix/arrow-writer-sparse-columns-panic

Conversation

@xe-nvdk
Copy link
Copy Markdown
Member

@xe-nvdk xe-nvdk commented Jan 19, 2026

… evolution

Fix for Issue #130: Arrow writer panics with "index out of range" during high-concurrency writes when batches have different column sets.

Root cause: mergeBatches() created columns of different lengths when batches had different schemas (e.g., some records had 'cpu' field, others had 'temperature'). When groupByHour() generated indices from the time column, accessing those indices on shorter columns caused panic.

Changes:

  • mergeBatches(): Normalize all columns to same length (totalRows from time column), using zero values for sparse positions
  • sliceColumnsByIndices(): Add defensive bounds checking as safety layer
  • Add tests for sparse column handling

Closes #130

… evolution

Fix for Issue #130: Arrow writer panics with "index out of range" during
high-concurrency writes when batches have different column sets.

Root cause: mergeBatches() created columns of different lengths when
batches had different schemas (e.g., some records had 'cpu' field,
others had 'temperature'). When groupByHour() generated indices from
the time column, accessing those indices on shorter columns caused panic.

Changes:
- mergeBatches(): Normalize all columns to same length (totalRows from
  time column), using zero values for sparse positions
- sliceColumnsByIndices(): Add defensive bounds checking as safety layer
- Add tests for sparse column handling

Closes #130
@xe-nvdk xe-nvdk merged commit 5dffc80 into main Jan 19, 2026
4 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.

Panic: index out of range in sliceColumnsByIndices during high concurrency writes

1 participant