Functions are defined in a .sdf.yml
block. The SDF YML schema definition is here. For YML autocomplete, please download the Red Hat YML extension in VSCode.
Notes:
- Define a new function signature in the appropriate dialect folder in the
signatures/
directory. - Please where possible, add the
cross-link
parameter to link to the official function documentation - Functions are monomorphic, so multiple signatures may be necessary for multiple datatypes
- Functions are unique for each dialect, and each input parameter set
Note: Please ensure that you are only adding a function that does not yet exist
---
function:
name: [name of the funtion]
description: [description of the function]
parameters:
- datatype: [datatype]
optional-parameters: []
returns:
datatype: [datatype]
implemented-by: builtin
cross-link: [link to official documentation]
variadic: [any, uniform, non-uniform, even-odd]
To contribute a function implementation, fill in the todo!()
block of a given function.
fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue> {
// start function impl
todo!()
// end function impl
}
Note: The // start function impl
comments are used to let the generator know that this function has been implemented. They