Skip to content

Add claim-check offloaded message field columns to rollout schema - #172

Merged
beinan merged 1 commit into
lance-format:mainfrom
ywu342:claim-check-message-fields
Jul 22, 2026
Merged

Add claim-check offloaded message field columns to rollout schema#172
beinan merged 1 commit into
lance-format:mainfrom
ywu342:claim-check-message-fields

Conversation

@ywu342

@ywu342 ywu342 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds five nullable LargeUtf8 columns to the rollout schema for oversized rollout-message fields written via the claim-check path:

  • model_input_string
  • model_output_string
  • rationale
  • problem_text
  • user_metadata

Each is an individually-projectable column, so a reader can select one without materializing the rest (rather than packing them into content / binary_payload).

Motivation

A downstream consumer persists oversized rollout-message fields as a claim-check row (one Lance row per message, one column per large field). The current published schema only supports content, input_tokens, output_tokens, output_logprobs; the other five fields were silently dropped on add() because they weren't in rollout_schema(). This adds them as first-class projectable columns.

Changes

Wired the five fields through every symmetric site:

  • crates/lance-context-core/src/rollout.rsRolloutRecord struct
  • crates/lance-context-core/src/rollout_store.rsrollout_schema(), records_to_batch (builders + appends + array inserts), batch_to_rollout_records (reads + construction)
  • crates/lance-context-api/src/lib.rsAddRolloutRequest + RolloutRecordDto
  • crates/lance-context-core/src/api_impl.rs + crates/lance-context-server/src/routes/rollouts.rs — both from_add_request / to_dto converters
  • test literals in master/routes.rs, master/scheduler.rs, tests/wal_merge_generation_cleanup.rs
  • specs/rollout-schema-design.md — documented the new column tier

All columns are nullable, so existing datasets and rows remain readable unchanged.

Test plan

  • Verify a write with the five new fields round-trips through add()get() and each column projects independently

Add five nullable LargeUtf8 columns to the rollout schema for oversized
rollout-message fields written via the claim-check path:
model_input_string, model_output_string, rationale, problem_text,
user_metadata. Each is an individually-projectable column so a reader can
select one without materializing the rest.

Wired through the RolloutRecord struct, rollout_schema(), records_to_batch,
batch_to_rollout_records, the AddRolloutRequest/RolloutRecordDto DTOs, and
both from_add_request/to_dto converters.
@beinan
beinan merged commit 08acd5b into lance-format:main Jul 22, 2026
9 checks passed
beinan added a commit that referenced this pull request Jul 23, 2026
## Summary
- evolve legacy base tables to the latest additive `rollout_schema()`
before WAL merge, adding missing nullable columns as all-null arrays
- align flushed WAL batches to the evolved base table schema so old
generations null-fill missing fields and newer generations preserve
populated fields
- reject missing required columns, type mismatches, and unknown columns
instead of silently dropping data
- preserve the existing base-first `scan_one_by_id` and
`lsm_scanner_for_source` read path
- keep legacy WAL point-lookup projections to columns guaranteed across
generations; absent post-#172 fields decode as `None`
- cover old base/old WAL merge, old base/new-schema value preservation,
and base/WAL point lookups

## Testing
- `cargo fmt --all -- --check`
- `cargo clippy --workspace --all-targets -- -D warnings`
- `cargo test -p lance-context-core -p lance-context-master --lib`
- `cargo test -p lance-context-core --lib claim_check -- --nocapture`
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