alamb commented on code in PR #5818:
URL: https://github.com/apache/arrow-datafusion/pull/5818#discussion_r1155094898


##########
datafusion/physical-expr/src/datetime_expressions.rs:
##########
@@ -280,10 +280,25 @@ pub fn date_trunc(args: &[ColumnarValue]) -> 
Result<ColumnarValue> {
 
     Ok(match array {
         ColumnarValue::Scalar(ScalarValue::TimestampNanosecond(v, tz_opt)) => {
-            ColumnarValue::Scalar(ScalarValue::TimestampNanosecond(
-                (f)(*v)?,
-                tz_opt.clone(),
-            ))
+            let nano = (f)(*v)?;
+            match granularity.as_str() {
+                "minute" => {

Review Comment:
   I wondered if we needed to apply the same treatment to `microsecond` and 
`millisecond`, and it appears that those granularities are not supported:
   
   I 
https://github.com/apache/arrow-datafusion/blob/771c20ce2f0ade29a2d334e4e8494e9fbd7a5940/datafusion/physical-expr/src/datetime_expressions.rs#L218
   
   (I was wondering as there are both Microsecond and Millisecond Timestamps as 
well)
   
https://github.com/apache/arrow-datafusion/blob/771c20ce2f0ade29a2d334e4e8494e9fbd7a5940/datafusion/common/src/scalar.rs#L116-L122



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