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 2022/11/08 18:43:47 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #4148: Add support for `DataType::Timestamp` casts in `unwrap_cast_in_comparison` optimizer pass

alamb commented on code in PR #4148:
URL: https://github.com/apache/arrow-datafusion/pull/4148#discussion_r1016995895


##########
datafusion/optimizer/src/unwrap_cast_in_comparison.rs:
##########
@@ -766,6 +818,105 @@ mod tests {
         );
     }
 
+    #[test]
+    fn test_try_cast_to_type_timestamps() {
+        for time_unit in [
+            TimeUnit::Second,
+            TimeUnit::Millisecond,
+            TimeUnit::Microsecond,
+            TimeUnit::Nanosecond,
+        ] {
+            let utc = Some("+0:00".to_string());
+            // No timezone, utc timezone
+            let (lit_tz_none, lit_tz_utc) = match time_unit {

Review Comment:
   A note on the timezone handling is that `expect_cast` added in https://github.com/apache/arrow-datafusion/pull/4147 and used in this PR explicitly verifies that  calling the arrow `cast` kernel produces the same result as the code in this PR. 



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