Weijun-H commented on code in PR #6654:
URL: https://github.com/apache/arrow-datafusion/pull/6654#discussion_r1244855952
##########
datafusion/physical-expr/src/datetime_expressions.rs:
##########
@@ -215,13 +215,17 @@ fn quarter_month(date: &NaiveDateTime) -> u32 {
}
fn date_trunc_single(granularity: &str, value: i64) -> Result<i64> {
+ if granularity == "millisecond" || granularity == "microsecond" {
+ return Ok(value);
+ }
Review Comment:
Due to the utilization of `with_nanosecond(0)`, the timestamp experiences a
reduction in granularity at the nanosecond level. But for "millisecond" and
"microsecond", we need to keep this granularity and truncate it later.
--
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]