MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / column_union

Function column_union

src/transform/src/typecheck.rs:509–520  ·  view source on GitHub ↗

Unions `other` into `typ`, returning a list of differences on failure This function returns an empty list when `typ` and `other` are a union

(
    typ: &mut ReprColumnType,
    other: &ReprColumnType,
)

Source from the content-addressed store, hash-verified

507///
508/// This function returns an empty list when `typ` and `other` are a union
509pub fn column_union(
510 typ: &mut ReprColumnType,
511 other: &ReprColumnType,
512) -> Vec<ReprColumnTypeDifference> {
513 let diffs = scalar_union(&mut typ.scalar_type, &other.scalar_type);
514
515 if diffs.is_empty() {
516 typ.nullable |= other.nullable;
517 }
518
519 diffs
520}
521
522/// Returns true when it is safe to treat a `sub` row as an `sup` row
523///

Callers 4

scalar_unionFunction · 0.85
typecheckMethod · 0.85
typecheck_scalarMethod · 0.85

Calls 2

scalar_unionFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected