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/04/11 08:03:37 UTC

[GitHub] [arrow-datafusion] tustvold opened a new issue, #5952: Incorrect Scalar Timezone Coercion

tustvold opened a new issue, #5952:
URL: https://github.com/apache/arrow-datafusion/issues/5952

   ### Describe the bug
   
   The scalar coercion logic currently incorrectly interprets a timezone without a timezone qualifier as a time since the UTC epoch. It should instead interpret it as relative to the timezone it is being cast to.
   
   ### To Reproduce
   
   https://github.com/apache/arrow-datafusion/pull/5914 added the following test (known to be incorrect at the time)
   
   ```
   query P
   select arrow_cast(timestamp '2000-01-01T00:00:00', 'Timestamp(Nanosecond, Some( "+08:00" ))');
   ----
   2000-01-01T08:00:00+08:00
   ```
   
   ### Expected behavior
   
   The correct result is 
   
   ```
   2000-01-01T00:00:00+08:00
   ```
   
   ### Additional context
   
   Following #5782  which includes the fix for https://github.com/apache/arrow-rs/issues/1936 the array cast is now correct
   
   ```
   create table foo as select '2000-01-01T00:00:00' as ts;
   ❯ select arrow_cast(ts, 'Timestamp(Nanosecond, Some( "+08:00" ))') from foo;
   +---------------------------+
   | foo.ts                    |
   +---------------------------+
   | 2000-01-01T00:00:00+08: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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] tustvold closed issue #5952: Incorrect Scalar Timezone Coercion

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold closed issue #5952: Incorrect Scalar Timezone Coercion
URL: https://github.com/apache/arrow-datafusion/issues/5952


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