feat(parquet): AuditReader::open_bytes for the RFC 0019 Store read path - #291
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAuditReader now accepts in-memory audit parquet bytes through a new ChangesAudit bytes-backed reader
Sequence Diagram(s)sequenceDiagram
participant Test
participant AuditWriter
participant FileSystem
participant AuditReader
participant from_chunk_reader
Test->>AuditWriter: write three_variants("acme")
AuditWriter->>FileSystem: write audit parquet file
Test->>FileSystem: read raw bytes
Test->>AuditReader: open_bytes(bytes)
AuditReader->>from_chunk_reader: open_bytes(bytes, "<object-store>")
from_chunk_reader-->>AuditReader: parsed AuditReader
AuditReader-->>Test: decoded events
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds an in-memory audit Parquet read entry point to support the RFC 0019 querier migration onto the Store seam (reading via Store::get_blocking → bytes) instead of directly from std::fs.
Changes:
- Introduces
AuditReader::open_bytes(Bytes)for reading audit Parquet from in-memory bytes. - Refactors shared Parquet-builder + required-column schema validation into
from_chunk_reader<R: ChunkReader>, used by bothopen_fileandopen_bytes. - Adds a round-trip test asserting
open_bytesproduces identicalAuditEvents to whatAuditWriterwrote.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/ourios-parquet/src/audit_reader.rs | Adds open_bytes and factors common ChunkReader-based reader construction with required-column checks. |
| crates/ourios-parquet/tests/audit_round_trip.rs | Adds a round-trip test covering the new in-memory open_bytes audit read path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/ourios-parquet/tests/audit_round_trip.rs`:
- Around line 194-217: The round-trip coverage for AuditReader::open_bytes is
currently only an integration-style example in audit_round_trip.rs, but it needs
to live next to the AuditReader implementation and be expressed as a property
test. Move the test into src/audit_reader.rs alongside
AuditReader::open_bytes/open_file, and rewrite it using proptest so it checks
the reconstruction invariant across generated event sequences rather than a
single fixed fixture. Keep the assertion that bytes read from the written audit
object round-trip through AuditReader::open_bytes and match the original events.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e8351657-c165-4cd7-aca3-99a3baf5a734
📒 Files selected for processing (2)
crates/ourios-parquet/src/audit_reader.rscrates/ourios-parquet/tests/audit_round_trip.rs
…d path Add `AuditReader::open_bytes(Bytes)` (mirroring `Reader::open_bytes`): build the audit reader from in-memory bytes with the same §3.7 baseline-column check, sharing a private `from_chunk_reader` helper with `open_file`. This is the prerequisite for the querier's audit scan to read through the `Store` seam (`Store::get_blocking` → bytes → here) on local or S3 (RFC 0019 §3.3 / slice 2a), rather than `std::fs`. Round-trip test asserts parity with the on-disk path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
e71ed61 to
cc69d63
Compare
What
RFC 0019 slice-2a prerequisite:
AuditReader::open_bytes(Bytes)— so the querier's audit scan can read audit Parquet through theStoreseam (Store::get_blocking→ bytes → here) on local or S3, rather thanstd::fs.How
Reader::open_bytes: builds theParquetRecordBatchReaderfrom in-memorybytes::Byteswith the same §3.7 baseline-REQUIRED-column check, skipping row-vs-path validation (likeopen_file). No filesystem access → noIoerror.from_chunk_reader<R: ChunkReader>helper shared byopen_file(aFile) andopen_bytes(Bytes) — no duplication.Tests
audit_reader_open_bytes_round_trips: write events viaAuditWriter, read the object's bytes, parse throughopen_bytes, assert fullAuditEventequality with what was written (parity with the on-disk path).cargo clippy -p ourios-parquet --all-targets --all-features -- -D warningsclean;cargo fmt --all --checkgreen.Context
Bounded, additive prerequisite for slice 2a (the querier
Storemigration). The §3.7 audit-isolation decision for that migration is settled (maintainer): rely on the #290 segment-wise prefix-scopedStore::listfor tenant isolation, dropping the local-only symlink-canonicalizebackstop (object storage — the production source of truth — has no symlinks; the residual local risk implies bucket write access). No§5scenario flips green here; RFC 0019 staysred.🤖 Generated with Claude Code
Summary by CodeRabbit