JavaScript UDFs
JavaScript UDFs are enabled by default, as described in
Prerequisites to Configure Non-containerized UDFs in the
System Administrator Guide.
Note: eval() function is not allowed in JavaScript UDFs.
Using Imports
All imports must be placed at the top of the UDF source and must contain an absolute path to the import file:
import “/my/full/path/source.js”
The imported JS file must include at least one exported function:
export function foo(arg1) { … }
With containerized UDFs, the path must always be /opt/Actian/vectorwise-udf/import. You can map this directory to a location available on the container’s host. For example:
create or replace function md5(a varchar(100)) return (varchar(100)) as language js source='
import * as m from "/opt/Actian/vectorwise-udf/import/md5.js"
return m.md5(a);
',commutative=true;\g
Conversely, when using non-containerized UDFs, the path can point to any location on the local host.
On VectorH, imported files must be available on all nodes.
Data Type Mapping
Vector data types map to JavaScript data types as follows:
Last modified date: 04/15/2025