Skip to main content

@terascope/data-mate / function-configs/interfaces / RecordTransformConfig

Interface: RecordTransformConfig<T>

Defined in: data-mate/src/function-configs/interfaces.ts:320

Extends​

Type Parameters​

Type ParameterDefault type
T extends Record<string, any>Record<string, unknown>

Properties​

PropertyModifierTypeDescriptionOverridesInherited fromDefined in
acceptsreadonlyreadonly FieldType[]Can be used in strongly typed contexts to throw early, some types or only compatible with a given operation-FunctionDefinitionConfig.acceptsdata-mate/src/function-configs/interfaces.ts:138
aliases?readonlyreadonly string[]Optionally specify other known aliases to this function-FunctionDefinitionConfig.aliasesdata-mate/src/function-configs/interfaces.ts:102
argument_schema?readonlyDataTypeFieldsUsed for validating and defining the types of the input arguments, please include description field when creating the schema-FunctionDefinitionConfig.argument_schemadata-mate/src/function-configs/interfaces.ts:126
categoryreadonlyFunctionDefinitionCategoryThe category of operation, for documentation purposes-FunctionDefinitionConfig.categorydata-mate/src/function-configs/interfaces.ts:113
createreadonly(config) => (value, index) => Record<string, unknown>---data-mate/src/function-configs/interfaces.ts:328
descriptionreadonlystringUsed to generate documentation-FunctionDefinitionConfig.descriptiondata-mate/src/function-configs/interfaces.ts:108
examples?readonlyreadonly FunctionDefinitionExample<T, unknown>[]Examples that will be used in the documentation and potentially in the automated tests. FIXME make this non-optional-FunctionDefinitionConfig.examplesdata-mate/src/function-configs/interfaces.ts:120
namereadonlystringThe name of the function, this should be considered case-insensitive, since some languages like SQL are case insensitive.-FunctionDefinitionConfig.namedata-mate/src/function-configs/interfaces.ts:97
output_typereadonly(inputConfig, args?) => ReadonlyDataTypeFields---data-mate/src/function-configs/interfaces.ts:324
required_arguments?readonlyreadonly 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_argumentsdata-mate/src/function-configs/interfaces.ts:132
sql?readonlySqlEmission<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.sqldata-mate/src/function-configs/interfaces.ts:160
typereadonlyRECORD_TRANSFORMType of operation that will be preformedFunctionDefinitionConfig.type-data-mate/src/function-configs/interfaces.ts:323
validate_arguments?readonly(args) => voidUsed for additional custom validation of args, called after generic arg validation-FunctionDefinitionConfig.validate_argumentsdata-mate/src/function-configs/interfaces.ts:141