viirya commented on code in PR #6654:
URL: https://github.com/apache/arrow-datafusion/pull/6654#discussion_r1244381902
##########
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:
I think for granularity as "second" | "millisecond" | "microsecond" cases,
`with_nanosecond(0)` looks correct in previous code.
It is okay to deferr the logic to the `_date_trunc`, but why only
"millisecond" and "microsecond" are treated specially?
--
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]