Is your feature request related to a problem or challenge?
Part of #9285 and #8045
The goal is to extract function definitions out of the datafusion core.
Describe the solution you'd like
Move the abs function to datafusion-functions
Target location: https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/math
Here is an example function: isnan: https://github.com/apache/arrow-datafusion/blob/e1f7b245168c5762135abc4e594bd81c508d7186/datafusion/functions/src/math/nans.rs#L31-L48
There is already coverage in https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/test_files/scalar.slt
Here are the steps I followed when porting isnan:
- Create a ScalarUDFImpl in the functions crate following an existing example, and stub out the
invoke() function with todo!().
- Make sure
cargo check -p datafusion-functions --all-features compiles successfully
- Remove the enum in
BuiltInScalarFunctions (source link)
- Try and build with
cargo check -p datafusion and the compiler will point out all the places in the code that has logic for this function
- While removing old code, copy the relevant parts back into the UDFs (like
signature, and return_type and implementation for invoke()
- Verify that the sqllogictests pass: `
Describe alternatives you've considered
No response
Additional context
No response
Is your feature request related to a problem or challenge?
Part of #9285 and #8045
The goal is to extract function definitions out of the datafusion core.
Describe the solution you'd like
Move the
absfunction todatafusion-functionsTarget location: https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/math
Here is an example function:
isnan: https://github.com/apache/arrow-datafusion/blob/e1f7b245168c5762135abc4e594bd81c508d7186/datafusion/functions/src/math/nans.rs#L31-L48There is already coverage in https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/test_files/scalar.slt
Here are the steps I followed when porting
isnan:invoke()function withtodo!().cargo check -p datafusion-functions --all-featurescompiles successfullyBuiltInScalarFunctions(source link)cargo check -p datafusionand the compiler will point out all the places in the code that has logic for this functionsignature, andreturn_typeand implementation forinvoke()Describe alternatives you've considered
No response
Additional context
No response