xudong963 commented on code in PR #27547:
URL: https://github.com/apache/datafusion/pull/27547#discussion_r4637467494
##########
datafusion/functions/src/datetime/date_trunc.rs:
##########
@@ -710,6 +721,16 @@ where
1 + 3 * ((date.month() - 1) / 3)
}
+/// The granularity `precision` always evaluates to, if that is known.
+fn constant_granularity(precision: &ExprProperties) -> Option<DatePart> {
+ let range = &precision.range;
+ if range.lower() != range.upper() {
+ return None;
+ }
+ let granularity = range.lower().try_as_str().flatten()?;
Review Comment:
https://github.com/apache/datafusion/pull/27547/changes/5d8a45d43fa2793439099661576690e2ebe842a9
avoids the to_lowercase()
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]