Weijun-H commented on code in PR #7729:
URL: https://github.com/apache/arrow-datafusion/pull/7729#discussion_r1343960892


##########
datafusion/expr/src/built_in_function.rs:
##########
@@ -618,13 +618,20 @@ impl BuiltinScalarFunction {
             BuiltinScalarFunction::ConcatWithSeparator => Ok(Utf8),
             BuiltinScalarFunction::DatePart => Ok(Float64),
             BuiltinScalarFunction::DateBin | BuiltinScalarFunction::DateTrunc 
=> {
-                match input_expr_types[1] {
-                    Timestamp(Nanosecond, _) | Utf8 | Null => {
+                match &input_expr_types[1] {
+                    Timestamp(Nanosecond, None) | Utf8 | Null => {
                         Ok(Timestamp(Nanosecond, None))
                     }
-                    Timestamp(Microsecond, _) => Ok(Timestamp(Microsecond, 
None)),
-                    Timestamp(Millisecond, _) => Ok(Timestamp(Millisecond, 
None)),
-                    Timestamp(Second, _) => Ok(Timestamp(Second, None)),
+                    Timestamp(Nanosecond, Some(tz)) => {
+                        Ok(Timestamp(Nanosecond, Some(Arc::clone(tz))))

Review Comment:
   ```suggestion
                       Timestamp(Nanosecond, tz_opt) => {
                           Ok(Timestamp(Nanosecond, tz_opt.clone())))
   ```



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