stuartcarnie commented on code in PR #2251:
URL: https://github.com/apache/arrow-rs/pull/2251#discussion_r934940959


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -1584,6 +1625,303 @@ fn cast_string_to_date64<Offset: OffsetSizeTrait>(
     Ok(Arc::new(array) as ArrayRef)
 }
 
+fn seconds_since_midnight(time: &chrono::NaiveTime) -> i32 {
+    let sec = time.num_seconds_from_midnight();
+    let frac = time.nanosecond();
+    let adjust = if frac < 1_000_000_000 { 0 } else { 1 };

Review Comment:
   It is possible to parse a time with a leap second, using the 60th second:
   
   
https://docs.rs/chrono/0.3.1/chrono/naive/time/index.html#reading-and-writing-leap-seconds
   
   The leap second is stored as a fractional second of 1_000_000_000 
nanoseconds, but I realise now that I don't need any logic to handle it. The 
code is much simpler 😂



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

Reply via email to