Skip to content

feat(sdk): MaterializedSeriesView reports its null samples (1.0.0) - #241

Merged
facontidavide merged 1 commit into
mainfrom
feat/series-view-validity
Nov 14, 2026
Merged

facontidavide merged 1 commit into
mainfrom
feat/series-view-validity

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

Problem

MaterializedSeriesView (what ToolboxHostView::readSeries returns) owns an Arrow struct whose value column carries a validity bitmap, but it exposes only the raw value pointers. A null sample (an empty CSV cell, an absent optional field) therefore reads as the zero the host puts in its slot, and a consumer has no way to tell it from a real 0.

PlotJuggler's own agent tools hit this: read_series and export_series report nulls as 0, which corrupts statistics such as a minimum.

Change

Two accessors on the view:

  • nullCount(): how many samples of the value column are null. 0 lets a caller skip the per-row check.
  • isNull(row): whether one sample is null.

A column without a bitmap, or with a declared null count of 0, has no nulls. A producer that did not count them (null_count == -1) gets them counted from the bitmap.

Versioning

Additive, client-side helpers compiled into the consumer: no host contract change, no feature_floors.json entry, and no ABI change (inline members of a header-only class). It fits the unreleased 1.0.0; the CHANGELOG has its line there. No version bump of its own.

Tests

pj_base/tests/materialized_series_view_test.cpp (new): five cases over hand-built Arrow structs (no bitmap, two nulls, uncounted nulls, a declared count of zero, an empty view).

Verification

  • ./build.sh --debug && ./test.sh: 108 of 108 pass, with sanitizers.
  • pre-commit run --all-files is clean.
  • Not run: abidiff against the baseline, and the Windows and macOS builds.

Follow-up

PlotJuggler pins 0.40.0, so its two readers can use these only after it moves to 1.0.0.

🤖 Generated with Claude Code

The view owns an Arrow struct whose value column carries a validity
bitmap, but it exposed only the raw value pointers: a null sample (an empty
CSV cell, an absent optional field) read as the zero the host puts in its
slot, and a consumer had no way to tell. nullCount() and isNull(row) read
the bitmap.

Client-side helpers only: no host contract change, no feature floor.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@facontidavide
facontidavide merged commit 3367f2e into main Nov 14, 2026
4 checks passed
@facontidavide
facontidavide deleted the feat/series-view-validity branch November 14, 2026 09:29
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