|
| 1 | +# 3DGS HHTL Datalake Traversal Plan — lance-graph |
| 2 | + |
| 3 | +## Goal |
| 4 | + |
| 5 | +Generalize the 3DGS / Cesium tile traversal pattern into a datalake traversal engine. |
| 6 | + |
| 7 | +The core insight: |
| 8 | + |
| 9 | +```text |
| 10 | +3D Tiles traversal |
| 11 | + selects visual tiles by camera, bounds, and error |
| 12 | +
|
| 13 | +Datalake HHTL traversal |
| 14 | + selects data blocks by query, metadata, distribution, and certified error |
| 15 | +``` |
| 16 | + |
| 17 | +This is likely the most immediate non-geospatial application of the 3DGS plan family. |
| 18 | + |
| 19 | +## Mapping |
| 20 | + |
| 21 | +```text |
| 22 | +3DGS / Cesium concept Datalake / query concept |
| 23 | +
|
| 24 | +Tile Lance fragment / Parquet row group / Iceberg file |
| 25 | +Bounding volume min/max stats / bloom / centroid / schema domain |
| 26 | +Geometric error approximation error / sketch error / stale-summary error |
| 27 | +Screen-space error query relevance / confidence error / hydration priority |
| 28 | +Camera frustum SQL predicate / Cypher pattern / semantic query focus |
| 29 | +Splat covariance distribution spread / embedding uncertainty / local dependency |
| 30 | +Refine hydrate deeper metadata or exact rows |
| 31 | +Skip certified prune |
| 32 | +Render return rows / aggregates / graph edges / vectors |
| 33 | +Tile decision report query planning decision report |
| 34 | +``` |
| 35 | + |
| 36 | +## HHTL traversal stages |
| 37 | + |
| 38 | +```text |
| 39 | +HEEL |
| 40 | + global dataset / table / partition pruning |
| 41 | + cheap filters: schema, partition key, time range, tenant, file stats |
| 42 | +
|
| 43 | +HIP |
| 44 | + row-group / fragment / family selection |
| 45 | + cheap semantic/vector/codebook basin checks |
| 46 | +
|
| 47 | +TWIG |
| 48 | + local sketches, centroids, histograms, covariance, bloom filters |
| 49 | + query-aware error estimates |
| 50 | +
|
| 51 | +LEAF |
| 52 | + exact rows, exact graph edges, exact vectors, exact payload hydration |
| 53 | +``` |
| 54 | + |
| 55 | +## Proposed crate/module shape |
| 56 | + |
| 57 | +```text |
| 58 | +crates/lance-hhtl-traversal/ |
| 59 | + mod.rs |
| 60 | + request.rs |
| 61 | + budget.rs |
| 62 | + candidate.rs |
| 63 | + metadata_scan.rs |
| 64 | + hhtl_decision.rs |
| 65 | + certificate.rs |
| 66 | + datafusion_bridge.rs |
| 67 | + graph_bridge.rs |
| 68 | + vector_bridge.rs |
| 69 | +``` |
| 70 | + |
| 71 | +Names are placeholders. Keep workspace-local until stable. |
| 72 | + |
| 73 | +## Request shape |
| 74 | + |
| 75 | +```rust |
| 76 | +pub struct DatalakeHhtlRequest { |
| 77 | + pub query_text: Option<String>, |
| 78 | + pub sql_predicate: Option<String>, |
| 79 | + pub graph_pattern: Option<String>, |
| 80 | + pub vector_query_ref: Option<String>, |
| 81 | + pub dataset_refs: Vec<String>, |
| 82 | + pub budget: DatalakeHhtlBudget, |
| 83 | +} |
| 84 | + |
| 85 | +pub struct DatalakeHhtlBudget { |
| 86 | + pub max_blocks_to_hydrate: usize, |
| 87 | + pub max_estimated_error: f32, |
| 88 | + pub min_confidence: f32, |
| 89 | + pub allow_approximate: bool, |
| 90 | + pub require_certificate: bool, |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +## Candidate metadata |
| 95 | + |
| 96 | +Each candidate block should expose a common metadata surface: |
| 97 | + |
| 98 | +```rust |
| 99 | +pub struct DataBlockCandidate { |
| 100 | + pub block_id: String, |
| 101 | + pub dataset_id: String, |
| 102 | + pub physical_ref: String, |
| 103 | + pub row_count: u64, |
| 104 | + pub byte_size: u64, |
| 105 | + pub stats_ref: Option<String>, |
| 106 | + pub vector_centroid_ref: Option<String>, |
| 107 | + pub schema_fingerprint: Option<u64>, |
| 108 | + pub freshness_epoch: Option<u64>, |
| 109 | +} |
| 110 | +``` |
| 111 | + |
| 112 | +## Decision report |
| 113 | + |
| 114 | +```rust |
| 115 | +pub enum DatalakeHhtlAction { |
| 116 | + Skip, |
| 117 | + KeepApproximate, |
| 118 | + HydrateMetadata, |
| 119 | + HydrateExactRows, |
| 120 | + HydrateVectors, |
| 121 | + HydrateGraphEdges, |
| 122 | +} |
| 123 | + |
| 124 | +pub struct DatalakeHhtlDecision { |
| 125 | + pub block_id: String, |
| 126 | + pub action: DatalakeHhtlAction, |
| 127 | + pub priority: f32, |
| 128 | + pub estimated_error: f32, |
| 129 | + pub confidence: f32, |
| 130 | + pub certificate_id: Option<String>, |
| 131 | + pub reason_codes: Vec<String>, |
| 132 | +} |
| 133 | +``` |
| 134 | + |
| 135 | +## Certificates |
| 136 | + |
| 137 | +A datalake traversal certificate should answer: |
| 138 | + |
| 139 | +```text |
| 140 | +Why was this block skipped? |
| 141 | +Why was this block hydrated? |
| 142 | +Which approximation was used? |
| 143 | +What error/confidence envelope justified the decision? |
| 144 | +Which metadata version was used? |
| 145 | +``` |
| 146 | + |
| 147 | +Potential certificate components: |
| 148 | + |
| 149 | +```text |
| 150 | +partition compatibility |
| 151 | +min/max predicate proof |
| 152 | +bloom filter proof |
| 153 | +centroid distance margin |
| 154 | +covariance/sketch uncertainty |
| 155 | +freshness/version proof |
| 156 | +query relevance score |
| 157 | +``` |
| 158 | + |
| 159 | +## Integration with DataFusion |
| 160 | + |
| 161 | +Potential integration points: |
| 162 | + |
| 163 | +```text |
| 164 | +logical plan analysis |
| 165 | +physical plan pruning |
| 166 | +custom table provider |
| 167 | +custom execution node |
| 168 | +EXPLAIN output extension |
| 169 | +``` |
| 170 | + |
| 171 | +The first useful path is probably an offline planner wrapper: |
| 172 | + |
| 173 | +```text |
| 174 | +SQL/query request |
| 175 | + -> HHTL traversal preplanner |
| 176 | + -> selected fragments |
| 177 | + -> DataFusion scan over selected fragments only |
| 178 | +``` |
| 179 | + |
| 180 | +## Integration with lance-graph |
| 181 | + |
| 182 | +Graph relationship model: |
| 183 | + |
| 184 | +```text |
| 185 | +Dataset -> Fragment -> RowGroup -> Page -> Row |
| 186 | +Dataset -> BlockCertificate |
| 187 | +Fragment -> Feature / VectorCentroid / SchemaFingerprint |
| 188 | +Query -> DecisionReport -> Fragment |
| 189 | +``` |
| 190 | + |
| 191 | +## First demo |
| 192 | + |
| 193 | +Keep the first demo small: |
| 194 | + |
| 195 | +```text |
| 196 | +one Lance/Parquet dataset |
| 197 | +one query predicate |
| 198 | +one metadata table |
| 199 | +one HHTL decision report |
| 200 | +one exact DataFusion scan over selected blocks |
| 201 | +one explanation: why skipped / hydrated |
| 202 | +``` |
| 203 | + |
| 204 | +## Acceptance criteria |
| 205 | + |
| 206 | +- Metadata-only traversal can select or skip blocks without reading payload rows. |
| 207 | +- Every skip/refine decision has machine-readable reason codes. |
| 208 | +- Approximate decisions include an error/confidence envelope. |
| 209 | +- Exact hydration is still available as a fallback. |
| 210 | +- The traversal can run before DataFusion execution. |
| 211 | +- The system can explain why a block was skipped. |
| 212 | + |
| 213 | +## Product framing |
| 214 | + |
| 215 | +This turns lakehouse access into hierarchical certified traversal: |
| 216 | + |
| 217 | +```text |
| 218 | +Do not scan the lake. |
| 219 | +Traverse it. |
| 220 | +``` |
0 commit comments