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


##########
datafusion/functions/src/datetime/date_part.rs:
##########
@@ -517,3 +525,35 @@ fn epoch(array: &dyn Array) -> Result<ArrayRef> {
     };
     Ok(Arc::new(f))
 }
+
+/// Invoke [`date_part`] on an `array` (e.g. Timestamp) and convert the
+/// result to a total number of nanoseconds as an Int64 array.
+fn seconds_ns(array: &dyn Array) -> Result<ArrayRef> {
+    let secs = date_part(array, DatePart::Second)?;
+    // This assumes array is primitive and not a dictionary
+    let secs = as_int32_array(secs.as_ref())?;
+    let subsecs = date_part(array, DatePart::Nanosecond)?;
+    let subsecs = as_int32_array(subsecs.as_ref())?;
+
+    // Special case where there are no nulls.
+    if subsecs.null_count() == 0 {

Review Comment:
   I re-reviewed the code and since they both come from calling arrow 
`date_part` I don't think this is necessary



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