martin-g commented on code in PR #19604:
URL: https://github.com/apache/datafusion/pull/19604#discussion_r2658444311
##########
datafusion/functions/src/math/nanvl.rs:
##########
Review Comment:
Add an arm for Float16
##########
datafusion/functions/src/math/nanvl.rs:
##########
@@ -97,7 +102,25 @@ impl ScalarUDFImpl for NanvlFunc {
}
fn invoke_with_args(&self, args: ScalarFunctionArgs) ->
Result<ColumnarValue> {
- make_scalar_function(nanvl, vec![])(&args.args)
+ if args.arg_fields.iter().any(|f| f.data_type().is_null()) {
+ return ColumnarValue::Scalar(ScalarValue::Null)
+ .cast_to(args.return_type(), None);
+ }
+
+ let target_type = args.return_type();
+ if !matches!(target_type, Float32 | Float64) {
Review Comment:
```suggestion
if !matches!(target_type, Float16 | Float32 | Float64) {
```
##########
datafusion/functions/src/math/iszero.rs:
##########
@@ -59,12 +60,14 @@ impl Default for IsZeroFunc {
impl IsZeroFunc {
pub fn new() -> Self {
- use DataType::*;
+ // Accept any numeric type and coerce to float
+ let float = Coercion::new_implicit(
+ TypeSignatureClass::Float,
Review Comment:
This also includes `Float16` but `fn iszero()` below currently handles only
Float32 and Float64.
--
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]