You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "gruuya (via GitHub)" <gi...@apache.org> on 2023/02/23 14:22:48 UTC

[GitHub] [arrow-rs] gruuya commented on a diff in pull request #3752: Enable casting of string to timestamp with microsecond resolution

gruuya commented on code in PR #3752:
URL: https://github.com/apache/arrow-rs/pull/3752#discussion_r1115765616


##########
arrow-cast/src/cast.rs:
##########
@@ -2562,26 +2573,35 @@ fn cast_string_to_timestamp_ns<Offset: OffsetSizeTrait>(
         .downcast_ref::<GenericStringArray<Offset>>()
         .unwrap();
 
+    let scale_factor = match TimestampType::get_time_unit() {
+        TimeUnit::Microsecond => 1_000,
+        TimeUnit::Nanosecond => 1,
+        _ => return Err(ArrowError::CastError("String to timestamp casting supports only microsecond or nanosecond resolution".to_string()))

Review Comment:
   Not to my knowledge; I can add them too if no one objects.



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