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

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #5914: arrow_cast to cast to timestamptz

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


##########
datafusion/sql/src/expr/arrow_cast.rs:
##########
@@ -580,8 +632,15 @@ mod test {
             DataType::Timestamp(TimeUnit::Millisecond, None),
             DataType::Timestamp(TimeUnit::Microsecond, None),
             DataType::Timestamp(TimeUnit::Nanosecond, None),
-            // TODO support timezones
-            //DataType::Timestamp(TimeUnit::Nanosecond, Some("UTC".into())),
+            // we can't cover all possible timezones, here we only test utc and +08:00
+            DataType::Timestamp(TimeUnit::Nanosecond, Some("+00:00".into())),
+            DataType::Timestamp(TimeUnit::Microsecond, Some("+00:00".into())),
+            DataType::Timestamp(TimeUnit::Millisecond, Some("+00:00".into())),
+            DataType::Timestamp(TimeUnit::Second, Some("+00:00".into())),
+            DataType::Timestamp(TimeUnit::Nanosecond, Some("+08:00".into())),
+            DataType::Timestamp(TimeUnit::Microsecond, Some("+08:00".into())),
+            DataType::Timestamp(TimeUnit::Millisecond, Some("+08:00".into())),
+            DataType::Timestamp(TimeUnit::Second, Some("+08:00".into())),

Review Comment:
   Some other test cases that would be good:
   
   `""` (empty timezone)
   
   Also errors:
   
   Three double quotes
   ```
   "Timestamp(Nanosecond, Some("+00:00""))" 
   ```



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