comphead commented on code in PR #7844:
URL: https://github.com/apache/arrow-datafusion/pull/7844#discussion_r1367672783


##########
datafusion/expr/src/built_in_function.rs:
##########
@@ -748,6 +751,7 @@ impl BuiltinScalarFunction {
             BuiltinScalarFunction::ToTimestamp => Ok(Timestamp(Nanosecond, 
None)),

Review Comment:
   Thanks @waitingkuo for raising it.
   I suppose for bunch of functions the return type gets changed  in 
`create_physical_expr` because `functions.rs` is on physical expr layer and 
rewrites the return type defined on logical layer. 
   
   For ints I would think the second is probably better return type
   If you try to present 0004-01-01 year in nanoseconds it will require higher 
value than `i64::MAX/MIN`
   https://doc.rust-lang.org/src/core/num/mod.rs.html#366
   
   ```
   make_type!(
       TimestampNanosecondType,
       i64,
       DataType::Timestamp(TimeUnit::Nanosecond, None),
       "A timestamp nanosecond type with an optional timezone."
   );
   ```
   But you are right we need to clean up builtin functions configuration in 
multiple places.



-- 
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]

Reply via email to