alamb commented on code in PR #22114:
URL: https://github.com/apache/datafusion/pull/22114#discussion_r4288063006


##########
datafusion/functions/src/datetime/date_trunc.rs:
##########
@@ -436,6 +457,105 @@ impl ScalarUDFImpl for DateTruncFunc {
         &self.aliases
     }
 
+    /// Compute the preimage for `date_trunc(granularity, col) = literal`.
+    ///
+    /// `date_trunc` floors a timestamp to the start of the given period, so
+    /// for any aligned literal `L` the preimage is the half-open interval
+    /// `[L, L + 1 granularity)`.
+    ///

Review Comment:
   Also added some examples



##########
datafusion/functions/src/datetime/date_part.rs:
##########
@@ -431,54 +431,6 @@ fn timezone_part_typed<T: ArrowTimestampType>(
     Ok(Arc::new(result))
 }
 
-fn date_to_scalar(date: NaiveDate, target_type: &DataType) -> 
Option<ScalarValue> {

Review Comment:
   moved to method on ScalarValue



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

Reply via email to