You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/06/27 21:11:49 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6783: Minor: Simplify `date_trunc` code and add comments

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


##########
datafusion/physical-expr/src/datetime_expressions.rs:
##########
@@ -284,9 +288,7 @@ fn _date_trunc(
     };
 
     // convert to nanoseconds
-    let Some(nano) = (f)(Some(value * scale))? else {
-        return Ok(None);
-    };
+    let nano = date_trunc_coarse(granularity, scale * value)?;

Review Comment:
   There is no need for a closure, and the function can be called directly which I think makes things easier to understand



-- 
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-unsubscribe@arrow.apache.org

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