Jefffrey commented on code in PR #23444:
URL: https://github.com/apache/datafusion/pull/23444#discussion_r3565468712


##########
datafusion/functions/src/datetime/date_part.rs:
##########
@@ -406,6 +408,32 @@ fn seconds_as_i32(array: &dyn Array, unit: TimeUnit) -> 
Result<ArrayRef> {
         return not_impl_err!("Date part {unit:?} not supported");
     }
 
+    // Fast path with seconds - no need to compute nanoseconds
+    if unit == Second {
+        return Ok(date_part(array, DatePart::Second)?);
+    }
+
+    // Fast path for Date32 and Date64 - no seconds
+    match array.data_type() {

Review Comment:
   btw my above comment is a way to simplify the code



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