@terascope/data-mate / function-configs/interfaces / RecordTransformConfig
Interface: RecordTransformConfig<T>
Defined in: data-mate/src/function-configs/interfaces.ts:320
Extends
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends Record<string, any> | Record<string, unknown> |
Properties
| Property | Modifier | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
accepts | readonly | readonly FieldType[] | Can be used in strongly typed contexts to throw early, some types or only compatible with a given operation | - | FunctionDefinitionConfig.accepts | data-mate/src/function-configs/interfaces.ts:138 |
aliases? | readonly | readonly string[] | Optionally specify other known aliases to this function | - | FunctionDefinitionConfig.aliases | data-mate/src/function-configs/interfaces.ts:102 |
argument_schema? | readonly | DataTypeFields | Used for validating and defining the types of the input arguments, please include description field when creating the schema | - | FunctionDefinitionConfig.argument_schema | data-mate/src/function-configs/interfaces.ts:126 |
category | readonly | FunctionDefinitionCategory | The category of operation, for documentation purposes | - | FunctionDefinitionConfig.category | data-mate/src/function-configs/interfaces.ts:113 |
create | readonly | (config) => (value, index) => Record<string, unknown> | - | - | - | data-mate/src/function-configs/interfaces.ts:328 |
description | readonly | string | Used to generate documentation | - | FunctionDefinitionConfig.description | data-mate/src/function-configs/interfaces.ts:108 |
examples? | readonly | readonly FunctionDefinitionExample<T, unknown>[] | Examples that will be used in the documentation and potentially in the automated tests. FIXME make this non-optional | - | FunctionDefinitionConfig.examples | data-mate/src/function-configs/interfaces.ts:120 |
name | readonly | string | The name of the function, this should be considered case-insensitive, since some languages like SQL are case insensitive. | - | FunctionDefinitionConfig.name | data-mate/src/function-configs/interfaces.ts:97 |
output_type | readonly | (inputConfig, args?) => ReadonlyDataTypeFields | - | - | - | data-mate/src/function-configs/interfaces.ts:324 |
required_arguments? | readonly | readonly string[] | Used to determine what of the possible args are required, as DataType configs does not have a mechanism to specify what is required | - | FunctionDefinitionConfig.required_arguments | data-mate/src/function-configs/interfaces.ts:132 |
sql? | readonly | SqlEmission<T> | How to run this function as a SQL expression instead of a JavaScript UDF. It is declared on the function definition, next to the name, arguments, accepted types and implementation, so it cannot drift from the rest of the definition. These definitions are also exposed as GraphQL directives, so they are the public surface. A JS UDF costs ~178 ns per value and runs single-threaded, because the Node binding blocks DuckDB's worker thread until JavaScript returns. Native SQL costs 1-2 ns per value and runs in parallel. An expression must return exactly what the function's UDF returns, and test/teal-frame/sql-emission-spec.ts checks that. Obvious translations often differ: JS trim() strips all Unicode whitespace while DuckDB's one-argument trim strips only spaces, and toUpperCase uses full case mapping while upper() uses simple mapping ('ß' becomes SS in JS and ẞ in SQL). | - | FunctionDefinitionConfig.sql | data-mate/src/function-configs/interfaces.ts:160 |
type | readonly | RECORD_TRANSFORM | Type of operation that will be preformed | FunctionDefinitionConfig.type | - | data-mate/src/function-configs/interfaces.ts:323 |
validate_arguments? | readonly | (args) => void | Used for additional custom validation of args, called after generic arg validation | - | FunctionDefinitionConfig.validate_arguments | data-mate/src/function-configs/interfaces.ts:141 |