You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/09 02:32:45 UTC
[GitHub] [arrow-rs] viirya commented on a diff in pull request #3494: Fix: Added support to cast string without time
viirya commented on code in PR #3494:
URL: https://github.com/apache/arrow-rs/pull/3494#discussion_r1064250136
##########
arrow-cast/src/parse.rs:
##########
@@ -121,6 +121,13 @@ pub fn string_to_timestamp_nanos(s: &str) -> Result<i64, ArrowError> {
return Ok(ts.timestamp_nanos());
}
+ // without a timezone specifier as a local time, only date
+ // Example: 2020-09-08
+ if let Ok(ts) =
+ NaiveDateTime::parse_from_str(&format!("{} 00:00:00", s), "%Y-%m-%d %H:%M:%S") {
Review Comment:
The time seems unnecessary. You can just parse date string like https://github.com/apache/arrow-rs/pull/3493/files?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org