pub struct ColumnMapping {
pub source_column: String,
pub target_column: String,
pub transform: Option<Option<String>>,
}Expand description
ColumnMapping : One source_column -> target_column pair, optionally carrying a transform expression that produces the value actually written.
Fields§
§source_column: StringWhere the value comes from in the source record. A plain identifier (user_id) for a relational source, or a dotted path (profile.address.city) reaching inside a structured value for a document source. A single-segment path is exactly the bare column name this field has always carried, so pre-existing mappings are unchanged. Every segment must be a valid identifier; JSON Pointer syntax and array indices are rejected. A connector that only reads top-level fields (Postgres) refuses a dotted path as a dry-run precondition failure rather than at run time – see Capabilities.nested_source_paths.
target_column: String§transform: Option<Option<String>>Optional restricted-CEL expression producing the value written to target_column. Omit it for a verbatim copy, which is what every mapping did before this field existed. Inside the expression value is this entry’s own source value and row.<column> reads another column of the same row – row may only be indexed by a literal column name, so the set of columns an expression reads is known before the run starts, fetched, and checked against the source schema. Deliberately restricted: an explicit allow-list of operators and functions (size, int, double, string, bool, has, startsWith, endsWith, contains, lowerAscii, upperAscii, trim, replace, split, join, substring), no I/O, no clock, no regular expressions, no iteration macros, no implicit type coercion, and both an evaluation-step and an output-size budget. Anything outside the allow-list is rejected at validation time and appears as a MappingIssue in the dry-run report, before any write.
Implementations§
Source§impl ColumnMapping
impl ColumnMapping
Sourcepub fn new(source_column: String, target_column: String) -> ColumnMapping
pub fn new(source_column: String, target_column: String) -> ColumnMapping
One source_column -> target_column pair, optionally carrying a transform expression that produces the value actually written.