Skip to main content

@terascope/data-mate / teal-frame/duck-values

teal-frame/duck-values

Interfaces​

InterfaceDescription
ValueConverterOptions-

Type Aliases​

InputNormalizer​

InputNormalizer = (value) => unknown

Defined in: data-mate/src/teal-frame/duck-values.ts:87

Rewrites the raw input for one field into a form that ingest coerces exactly.

Parameters​

ParameterType
valueunknown

Returns​

unknown


ValueConverter​

ValueConverter = (value) => unknown

Defined in: data-mate/src/teal-frame/duck-values.ts:26

Converts values already produced by coerceToType into the form a DuckDB vector accepts.

Coercion itself is done by coerceToType, so field semantics are not reimplemented here. The conversions follow the field config and must match DataType.toDuckDB(); a mismatch makes DuckDB reject the append rather than store the wrong value.

Parameters​

ParameterType
valueunknown

Returns​

unknown

Functions​

makeBigIntInputNormalizer()​

makeBigIntInputNormalizer(fieldConfig, childConfig?): InputNormalizer | undefined

Defined in: data-mate/src/teal-frame/duck-values.ts:96

Returns the bigint normalizer for one field, or undefined when the field contains no Long, so most fields pay no per-row cost.

It follows the field's config, not the value, so only Long positions change: a bigint in an Any field stays a bigint. It returns new values and never modifies the caller's record.

Parameters​

ParameterType
fieldConfigDataTypeFieldConfig
childConfig?DataTypeFields | ReadonlyDataTypeFields

Returns​

InputNormalizer | undefined


makeValueConverter()​

makeValueConverter(fieldConfig, childConfig?, options?): ValueConverter

Defined in: data-mate/src/teal-frame/duck-values.ts:168

Returns the converter for one field.

Null and undefined become null. coerceToType skips nils via callIfNotNil, so the converter must not turn a nil into an empty value either (such as a [NULL] list or a struct of nulls).

Parameters​

ParameterType
fieldConfigDataTypeFieldConfig
childConfig?DataTypeFields | ReadonlyDataTypeFields
options?ValueConverterOptions

Returns​

ValueConverter