pub struct TypeMapping {
pub column_name: String,
pub source_native_type: String,
pub rivet_type: RivetType,
pub arrow_type: Option<DataType>,
pub fidelity: TypeFidelity,
pub nullable: bool,
pub warnings: Vec<String>,
}Expand description
One row of the Type Mapping Pipeline (roadmap §6 TypeMapping).
Carries the full provenance from a source-DB column to its eventual
Arrow representation. The struct is what the type-report CLI prints
and what TypePolicy validates against.
Fields§
§column_name: StringColumn name (matches SourceColumn::name).
source_native_type: StringNative source-DB type identifier (numeric(18,2), timestamptz,
jsonb, …).
rivet_type: RivetTypeThe canonical Rivet type produced by the vendor mapper.
arrow_type: Option<DataType>Resolved Arrow type, or None for RivetType::Unsupported until
a policy turns it into something exportable.
Kept as arrow::DataType (not a stringly-typed name) so the
pipeline can build an arrow::Schema directly from a
Vec<TypeMapping>.
fidelity: TypeFidelityFidelity classification — see TypeFidelity.
nullable: boolTrue when the source schema declares the column nullable. Threaded
from SourceColumn::nullable so build_arrow_field doesn’t need
the original column.
warnings: Vec<String>Diagnostic strings emitted by the mapper or the policy. Surfaced by the type-report and the strict-mode failure message.
Implementations§
Source§impl TypeMapping
impl TypeMapping
Sourcepub fn from_source(source: &SourceColumn, rivet_type: RivetType) -> Self
pub fn from_source(source: &SourceColumn, rivet_type: RivetType) -> Self
Build a mapping from a SourceColumn and an already-resolved
RivetType. The Arrow type is computed by rivet_type_to_arrow
and the fidelity by derive_fidelity.
This is the canonical constructor used by every vendor mapper — Chunks 2/3 will call this once per source column.
Sourcepub fn with_warning(self, msg: impl Into<String>) -> Self
pub fn with_warning(self, msg: impl Into<String>) -> Self
Append a warning visible to the type-report and to logs.
Trait Implementations§
Source§impl Clone for TypeMapping
impl Clone for TypeMapping
Source§fn clone(&self) -> TypeMapping
fn clone(&self) -> TypeMapping
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more