|
| 1 | +# Unit A.3a — Rust driver side — review log |
| 2 | + |
| 3 | +Branch: `pr/delta-A3a-rust-driver` (based on `pr/delta-A2-buildgate`). |
| 4 | +Commit: `1a774d02d` (single commit; review fixes amended in). |
| 5 | + |
| 6 | +## Carve (from `feat/delta-kernel-read`) |
| 7 | +10 files, +4374/-50 (the bulk is the two Cargo.lock regens: native +202, contrib standalone +~1.5k). |
| 8 | +- Verbatim copies: `error.rs` (61), `engine.rs` (468), `predicate.rs` (697), `scan.rs` (779), |
| 9 | + `jni.rs` (617) = 2622 lines of driver code, proven in the monolith (54 unit tests). |
| 10 | +- Carved `lib.rs`: declares the 5 driver modules + keeps the `planner` STUB; drops the |
| 11 | + `dv_reader`/`kernel_scan` module decls (A.3b). |
| 12 | +- Trimmed real `Cargo.toml`: only the deps the driver set uses (delta_kernel, object_store, arrow, |
| 13 | + url, jni, prost, serde_json, thiserror, log + proto/jni-bridge path deps). Executor deps |
| 14 | + (parquet, roaring, datafusion-datasource, futures, chrono*, comet-common, tokio) deferred to A.3b. |
| 15 | +- Gate-verify `cargo-tree` assertion re-tightened to require `delta_kernel` (now real, not a stub). |
| 16 | + |
| 17 | +## Carve invariants (verified) |
| 18 | +- Driver set has ZERO non-comment references to deferred modules (dv_reader/kernel_scan/planner). |
| 19 | +- A.3a touches ONLY `contrib/delta/native/` + `native/Cargo.lock` + the gate script. No core, no JVM. |
| 20 | +- The A.2 stub `planner.rs` is byte-unchanged and still returns NotImplemented. |
| 21 | + |
| 22 | +## §5 verification (all green) |
| 23 | +gated native build; 54 in-crate unit tests (cargo test); default native build unchanged; clippy |
| 24 | +(both feature states); gate-verify script (now asserts delta_kernel, contrib libcomet +11 MB); |
| 25 | +cargo fmt (native + contrib standalone). |
| 26 | + |
| 27 | +## Review round (manual + /code-review high, 22-agent workflow: 6 refuted, 6 survived) |
| 28 | +**Fixed (folded into the commit):** |
| 29 | +- **[lib.rs] dead `crate::proto` re-export** (CONFIRMED): `DeltaScan`/`DeltaScanCommon` were re-exported |
| 30 | + but no driver module uses them via `crate::proto` (the stub planner imports them directly from |
| 31 | + `datafusion_comet_proto`). Trimmed to the driver's real proto surface |
| 32 | + (`DeltaDvDescriptor`/`DeltaPartitionValue`/`DeltaScanTask`/`DeltaScanTaskList`); A.3b re-adds the |
| 33 | + envelopes when the real planner lands. Consistent with the Cargo.toml "declare what you use" trim. |
| 34 | +- **[Cargo.toml] unused `datafusion` `parquet` feature** (CONFIRMED): the driver only needs |
| 35 | + `ExecutionPlan`/`SchemaRef`/`DataFusionError` (stub planner); dropped the feature (A.3b re-adds it |
| 36 | + for the real parquet scan). Lockfile unchanged (parquet stays via delta_kernel transitively). |
| 37 | +- **[lib.rs] misleading `[plan_delta_scan]` doc-link** (CONFIRMED): the module doc implied the |
| 38 | + crate-root `scan::plan_delta_scan` is what core's dispatcher calls, but core calls |
| 39 | + `planner::plan_delta_scan` (the stub). Reworded to disambiguate the two same-named functions. |
| 40 | + |
| 41 | +**Documented (not fixed — verbatim monolith code, latent, not carve-introduced):** |
| 42 | +- **[scan.rs:691/693] DV offset/sizeInBytes unguarded Arrow reads** (PLAUSIBLE): `a.value(i)` without |
| 43 | + `is_null` on the DV size/cardinality fields, and an i32->u64 offset cast that would wrap a negative. |
| 44 | + Both are real mechanisms but gated behind Delta DV invariants (non-null sizeInBytes, non-negative |
| 45 | + offset) that valid tables never violate. This is verbatim, test-passing monolith code; fixing it in |
| 46 | + the carve would diverge A.3a from the monolith. Candidate for a separate monolith-level hardening |
| 47 | + pass, NOT an A.3a change. |
| 48 | + |
| 49 | +**Refuted (6):** the `scan::plan_delta_scan` vs `planner::plan_delta_scan` name "collision" (two fns |
| 50 | +in different modules is fine in Rust), the arrow feature set (transitively fine), the CONTRIB_HITS>=2 |
| 51 | +gate brittleness. |
| 52 | + |
| 53 | +**State:** A.3a review clean. Ready to open upstream once A.2 (#4 → upstream) lands; depends on A.3a's |
| 54 | +base chain (A.1 #4700 -> A.2 -> A.3a). |
0 commit comments