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

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

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


##########
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:
   Is there a particular reason not to just support the full set whilst here?



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