Skip to main content

@terascope/data-mate / teal-frame/udf-types

teal-frame/udf-types

Interfaces​

InterfaceDescription
UdfTypeOptions-

Type Aliases​

InputConverter​

InputConverter = (value) => unknown

Defined in: data-mate/src/teal-frame/udf-types.ts:128

Parameters​

ParameterType
valueunknown

Returns​

unknown

Functions​

makeInputConverter()​

makeInputConverter(field, childConfig?): InputConverter

Defined in: data-mate/src/teal-frame/udf-types.ts:189

The inverse of makeValueConverter: converts the value DuckDB passes to a scalar function into the value DataFrame would pass to the same function.

  • A Date becomes what DateVector holds: epoch millis, or an [ms, offset] tuple. No string parsing is involved, so the result does not depend on the host time zone.
  • A LIST becomes a JS array, and a STRUCT becomes an object (or, for a Tuple, an array).
  • A GEOMETRY becomes the GeoShape its WKB encodes.
  • A JSON column (Any or an untyped Object) is stored as JSON text, so it is parsed.
  • A Long stays a bigint, which the functions already expect.

Parameters​

ParameterType
fieldDataTypeFieldConfig | FieldTypeLike
childConfig?Children

Returns​

InputConverter


udfTypeFor()​

udfTypeFor(fieldConfig, childConfig?, options?): DuckDBType

Defined in: data-mate/src/teal-frame/udf-types.ts:91

Returns the DuckDB type object for a field config, or throws if the type has none.

Parameters​

ParameterType
fieldConfigDataTypeFieldConfig
childConfig?Children
options?UdfTypeOptions

Returns​

DuckDBType