niebayes commented on code in PR #14060:
URL: https://github.com/apache/datafusion/pull/14060#discussion_r1909055517


##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -551,6 +551,10 @@ fn get_valid_types(
             // and their default type is double precision
             if logical_data_type == NativeType::Null {
                 valid_type = DataType::Float64;
+            } else if !logical_data_type.is_numeric() {
+                return plan_err!(
+                    "The signature expected NativeType::Numeric but received 
{logical_data_type}"
+                );

Review Comment:
   I'm not entirely clear on the rationale for falling back to Float64 when the 
argument is of type Null. 
   However, I choose to keep this logic and make it a short-circuit before the 
numeric check.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to