Jefffrey commented on code in PR #18304:
URL: https://github.com/apache/datafusion/pull/18304#discussion_r2465923704
##########
datafusion/functions/src/math/abs.rs:
##########
@@ -34,6 +35,7 @@ use datafusion_expr::{
Volatility,
};
use datafusion_macros::user_doc;
+use num_traits::sign::Signed;
Review Comment:
We need num_traits to get the abs implementation for f16 as it's only
implemented for this trait:
https://docs.rs/half/latest/half/struct.f16.html#method.abs-2
##########
datafusion/functions/src/math/abs.rs:
##########
@@ -81,6 +83,7 @@ macro_rules! make_decimal_abs_function {
/// Return different implementations based on input datatype to reduce
branches during execution
fn create_abs_function(input_data_type: &DataType) ->
Result<MathArrayFunction> {
match input_data_type {
+ DataType::Float16 => Ok(make_abs_function!(Float16Array)),
Review Comment:
Fix here
##########
datafusion/sqllogictest/test_files/math.slt:
##########
@@ -139,16 +139,16 @@ select abs(arrow_cast('-1.2', 'Utf8'));
statement ok
CREATE TABLE test_nullable_integer(
- c1 TINYINT,
Review Comment:
I changed my editor to remove trailing whitespaces on write hence these
changes; I wonder if we should have a lint for SLT files? 🤔
##########
datafusion/functions/src/math/abs.rs:
##########
@@ -152,35 +156,7 @@ impl ScalarUDFImpl for AbsFunc {
}
fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
- match arg_types[0] {
Review Comment:
Just a little cleanup
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]