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 2021/02/08 21:57:22 UTC
[GitHub] [arrow] ovr opened a new pull request #9449: ARROW-11563: [Rust] Implement Cast(Utf8, TimeStamp(Nanoseconds, None))
ovr opened a new pull request #9449:
URL: https://github.com/apache/arrow/pull/9449
DataFushion already has this cast with its own implementation inside DF based on top of the chrono library. In this PR, I moved functions called string_to_timestamp_nanos and naive_datetime_to_timestamp (helpers) to Arrow's compute::kernels crate to make it possible to do Cast(Utf8, Timestamp(Nanoseconds, None)) and usage these helpers inside DF for to_timestamp function.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] alamb closed pull request #9449: ARROW-11563: [Rust] Support Cast(Utf8, TimeStamp(Nanoseconds, None))
Posted by GitBox <gi...@apache.org>.
alamb closed pull request #9449:
URL: https://github.com/apache/arrow/pull/9449
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #9449: ARROW-11563: [Rust] Implement Cast(Utf8, TimeStamp(Nanoseconds, None))
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9449:
URL: https://github.com/apache/arrow/pull/9449#issuecomment-775490496
https://issues.apache.org/jira/browse/ARROW-11563
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] ovr commented on a change in pull request #9449: ARROW-11563: [Rust] Support Cast(Utf8, TimeStamp(Nanoseconds, None))
Posted by GitBox <gi...@apache.org>.
ovr commented on a change in pull request #9449:
URL: https://github.com/apache/arrow/pull/9449#discussion_r573681017
##########
File path: rust/arrow/src/compute/kernels/cast.rs
##########
@@ -1480,6 +1498,19 @@ mod tests {
assert!(c.is_null(2));
}
+ #[test]
+ fn test_cast_string_to_timestamp() {
+ let a = StringArray::from(vec![Some("2020-09-08T12:00:00+00:00"), None]);
Review comment:
Sure, good catch 👍
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] alamb commented on a change in pull request #9449: ARROW-11563: [Rust] Support Cast(Utf8, TimeStamp(Nanoseconds, None))
Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #9449:
URL: https://github.com/apache/arrow/pull/9449#discussion_r573286775
##########
File path: rust/arrow/src/compute/kernels/cast.rs
##########
@@ -1480,6 +1498,19 @@ mod tests {
assert!(c.is_null(2));
}
+ #[test]
+ fn test_cast_string_to_timestamp() {
+ let a = StringArray::from(vec![Some("2020-09-08T12:00:00+00:00"), None]);
Review comment:
I recommend adding an error case here too -- like `Some("not a date")` to ensure / encode the make-a-null-if-invalid-parse behavior
##########
File path: rust/arrow/src/error.rs
##########
@@ -27,6 +27,7 @@ pub enum ArrowError {
/// Returned when functionality is not yet available.
NotYetImplemented(String),
ExternalError(Box<dyn Error + Send + Sync>),
+ CastError(String),
Review comment:
Adding a new Arrow Error variant seems reasonable to me -- what do you think @jorgecarleitao and @nevi-me and @andygrove ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] ovr commented on pull request #9449: ARROW-11563: [Rust] Support Cast(Utf8, TimeStamp(Nanoseconds, None))
Posted by GitBox <gi...@apache.org>.
ovr commented on pull request #9449:
URL: https://github.com/apache/arrow/pull/9449#issuecomment-778066965
Just a notice: Rebased
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] alamb commented on pull request #9449: ARROW-11563: [Rust] Support Cast(Utf8, TimeStamp(Nanoseconds, None))
Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #9449:
URL: https://github.com/apache/arrow/pull/9449#issuecomment-777822737
I think this PR is ready to go after a rebase -- any thoughts @Dandandan @jorgecarleitao or @andygrove ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] nevi-me commented on a change in pull request #9449: ARROW-11563: [Rust] Support Cast(Utf8, TimeStamp(Nanoseconds, None))
Posted by GitBox <gi...@apache.org>.
nevi-me commented on a change in pull request #9449:
URL: https://github.com/apache/arrow/pull/9449#discussion_r574882397
##########
File path: rust/arrow/src/error.rs
##########
@@ -27,6 +27,7 @@ pub enum ArrowError {
/// Returned when functionality is not yet available.
NotYetImplemented(String),
ExternalError(Box<dyn Error + Send + Sync>),
+ CastError(String),
Review comment:
I'm happy with the addition
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] alamb commented on pull request #9449: ARROW-11563: [Rust] Support Cast(Utf8, TimeStamp(Nanoseconds, None))
Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #9449:
URL: https://github.com/apache/arrow/pull/9449#issuecomment-778131728
Thanks again @ovr !
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org