Skip to main content

@terascope/data-mate / teal-frame/schema-check

teal-frame/schema-check

Interfaces​

InterfaceDescription
SchemaMismatchOne disagreement between a frame's declared DataTypeConfig and the column types DuckDB actually produces.

Functions​

describeColumns()​

describeColumns(frame): Promise<Record<string, string>>

Defined in: data-mate/src/teal-frame/schema-check.ts:30

Returns the DuckDB column type of each column in a frame, for diagnosis and for checking a config against what DuckDB produced.

Parameters​

ParameterType
frameTealFrame

Returns​

Promise<Record<string, string>>


diffSchema()​

diffSchema(frame): Promise<SchemaMismatch[]>

Defined in: data-mate/src/teal-frame/schema-check.ts:48

Compares a frame's declared config with the column types DuckDB actually produced. An empty array means they agree.

A column's type comes from its SQL expression, not from the config, so a projection can declare Integer while its SQL yields VARCHAR. Aggregations are a common case: DuckDB promotes sum(BIGINT) to HUGEINT, while data-mate treats the result as a Long.

Returns the differences rather than throwing, so a caller can assert on them, log them, or ignore kinds it does not care about.

Parameters​

ParameterType
frameTealFrame

Returns​

Promise<SchemaMismatch[]>