Conversation
Signed-off-by: "Nicholas Gates" <nick@nickgates.com>
Merging this PR will not alter performance
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | chunked_varbinview_canonical_into[(100, 100)] |
307.8 µs | 273 µs | +12.72% |
| ❌ | Simulation | chunked_varbinview_opt_canonical_into[(1000, 10)] |
187.6 µs | 225 µs | -16.6% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ngates/file-metadata-segments (9b7f99a) with develop (d71d3d3)
|
@claude review this |
|
Claude finished @gatesn's task in 3m 45s —— View job PR Review: [codex] Add Vortex file metadata segments
Overall this is a clean, well-structured feature. The FlatBuffers schema design is backward-compatible, the round-trip test is solid, and the alignment/padding logic in Design / API1. Eager loading in the initial read window (your own comment on deserializer.rs:126) In for metadata in &postscript.metadata {
read_more_offset = read_more_offset.min(metadata.segment.offset);
}For callers that never touch metadata, this inflates the initial read window and pays the I/O cost of fetching every metadata buffer on every file open. This is fine for small metadata (the primary motivation seems to be "sidecar data for the file"), but it becomes a tax for large payloads. Your suggested 2. Slice vs.
3. Returning Correctness4. O(n²) duplicate-key check in // postscript.rs:87-93
for (idx, entry) in metadata.iter().enumerate() {
if metadata[..idx].iter().any(|prev| prev.key == entry.key) {
return Err(...);
}
}This is quadratic in the number of metadata entries. Since the postscript size is bounded by let mut seen = std::collections::HashSet::with_capacity(metadata.len());
for entry in &metadata {
if !seen.insert(&entry.key) {
return Err(vortex_err!("Postscript contains duplicate metadata key {}", entry.key));
}
}5. No validation of empty keys An empty-string key 6. Missing The generated accessor Testing7. Duplicate-key rejection has no test The guard at 8. Large metadata test exercises the The Documentation9. File format diagram in The illustrated diagram shows "Per-Column Statistics" (layout-embedded stats) and skips to "User Metadata Segments", but there is a separate File Statistics Flatbuffer segment emitted by Performance regression (CodSpeed)The 12.25% regression on |
Signed-off-by: "Nicholas Gates" <nick@nickgates.com>
Signed-off-by: "Nicholas Gates" <nick@nickgates.com>
Signed-off-by: "Nicholas Gates" <nick@nickgates.com>
Signed-off-by: "Nicholas Gates" <nick@nickgates.com>
Signed-off-by: "Nicholas Gates" <nick@nickgates.com>
|
What do you want to add this for? |
|
This PR has been marked as stale because it has been open for 14 days with no activity. Please comment or remove the stale label if you wish to keep it active, otherwise it will be closed in 7 days |
|
This PR was closed because it has been inactive for 7 days since being marked as stale. |
Pull request was closed
Adds optional file-level metadata to the Vortex file format: a set of string-keyed, opaque byte segments referenced from the postscript, for consumers that need to attach identity or annotation to a file (Iceberg field IDs, an Arrow-metadata round-trip, provenance). Keys and their segment locators live in the postscript and are read at open; the opaque values load only when a reader opts in with `include_metadata`, resolved one locator at a time through the file's existing segment source — served from the initial footer read when they fall inside it, otherwise a targeted read. A default open never materializes them and makes no metadata-driven read. The `DType`, its FlatBuffers and protobuf serialization, and the scan path are unchanged; the wire change is a single additive `Postscript` field, so old readers skip it and the file version stays `1`. This revives #7954 (the original file-metadata-segments work) rebased onto develop, with the read path reshaped so metadata is never folded into the footer's contiguous tail read and never keeps that buffer alive: values are resolved per-locator and copied out. `Footer` carries only the locators, so a cached footer is identical whether or not the opener asked for metadata, and one file's metadata can't surface for another through the multi-file cache. Parsing a segment alignment from an untrusted postscript now returns an error rather than panicking on an out-of-range exponent (the TUI inspector included). The public read API is additive — `VortexFile` gains metadata accessors and `VortexOpenOptions` an `include_metadata` opt-in — and `Footer::new` is unchanged; the generated `Postscript` FlatBuffer gains a field, as any additive schema change does. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: mprammer <martin@spiraldb.com> Co-authored-by: Nicholas Gates <nick@nickgates.com> Co-authored-by: Claude <noreply@anthropic.com>
Summary
Adds keyed user-defined metadata segments to Vortex files. Writers can attach
ByteBuffermetadata by string key, and readers can retrieve those buffers fromVortexFileorFooterafter opening a file.The segment locations are stored in the postscript alongside the existing dtype, layout, statistics, and footer segment specs. The footer deserializer includes metadata segments in its initial footer read window, so large metadata payloads are read back correctly even when they sit before the footer flatbuffers.
No existing issue was found for this change, so this PR does not use a
Fixes #...trailer.Validation
cargo +nightly fmt --all./scripts/public-api.shcargo clippy --all-targets --all-featurescargo test -p vortex-filegit diff --check