pub struct MappingSpec {
pub version: u32,
pub tables: Vec<TableMapping>,
}Expand description
Top-level mapping file.
version: 1
tables:
- table: lake.social.users
mode: incremental
pipeline:
- vertex: { label: Person, id_column: user_id, properties: [name] }
- fk_edges:
type: WORKS_AT
src: { label: Person, column: user_id }
dst: { label: Company, column: company_id }
properties: [since] # edge property columns
rename: { since: joined_at } # optional column → prop renamingFields§
§version: u32§tables: Vec<TableMapping>Implementations§
Source§impl MappingSpec
impl MappingSpec
pub fn from_yaml(yaml: &str) -> Result<Self>
pub fn load(path: impl AsRef<Path>) -> Result<Self>
Sourcepub fn from_ron(ron: &str) -> Result<Self>
pub fn from_ron(ron: &str) -> Result<Self>
Parse a MappingSpec from RON — the constellation’s
RON-as-description form, sibling to from_yaml.
RON parity closes the seam the findings doc named: the Iceberg→graph
mapping is now a first-class RON object like every other spec, and RON is
what from_arrow_schema emits. YAML stays
accepted — this is additive.
Sourcepub fn to_ron(&self) -> Result<String>
pub fn to_ron(&self) -> Result<String>
Render this spec to RON text (pretty, stable field order via the
struct derive) — the round-trip partner of from_ron.
Sourcepub fn from_arrow_schema(table: &str, schema: &Schema) -> SchemaMappingCandidate
pub fn from_arrow_schema(table: &str, schema: &Schema) -> SchemaMappingCandidate
Derive a candidate MappingSpec from an Iceberg table’s Arrow
schema — the schema→mapping codegen half of the RON seam.
The generator emits ONE vertex per table, a best-guess id column, the
remaining scalar columns as vertex properties, and one fk_edges
candidate per foreign-key-shaped (*_id) column. It is meant to be
emitted as RON, reviewed, and corrected by a human — it is a starting
point, not an oracle.
Honest by construction (the findings-doc law): no column is ever
silently dropped. Every input field is accounted for exactly once —
mapped as the id, a property, or an FK edge endpoint, or else SURFACED in
SchemaMappingCandidate::unmapped (a nested/complex type that cannot
become a scalar graph property). Every guessed role (the id column,
each FK edge) is recorded in SchemaMappingCandidate::guesses so a
reviewer knows precisely what to check.
Trait Implementations§
Source§impl Clone for MappingSpec
impl Clone for MappingSpec
Source§impl Debug for MappingSpec
impl Debug for MappingSpec
Source§impl<'de> Deserialize<'de> for MappingSpec
impl<'de> Deserialize<'de> for MappingSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl GraphMapping for MappingSpec
impl GraphMapping for MappingSpec
fn compile(&self) -> Result<MappingSpec>
Auto Trait Implementations§
impl Freeze for MappingSpec
impl RefUnwindSafe for MappingSpec
impl Send for MappingSpec
impl Sync for MappingSpec
impl Unpin for MappingSpec
impl UnsafeUnpin for MappingSpec
impl UnwindSafe for MappingSpec
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more