You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2023/03/08 19:59:48 UTC

[GitHub] [arrow-datafusion] Jefffrey commented on pull request #5166: feat: add `arrow_cast` function to support supports arbitrary arrow types

Jefffrey commented on PR #5166:
URL: https://github.com/apache/arrow-datafusion/pull/5166#issuecomment-1460772956

   Just did some quick testing, noticed a minor quirk:
   
   ```sql
   ❯ select arrow_cast(to_timestamp('2020-01-02 01:01:11.1234567890Z'), '          Timestamp        (Nanosecond,      None               )');
   +------------------------------------------------------+
   | totimestamp(Utf8("2020-01-02 01:01:11.1234567890Z")) |
   +------------------------------------------------------+
   | 2020-01-02T01:01:11.123456789                        |
   +------------------------------------------------------+
   1 row in set. Query took 0.003 seconds.
   ❯ select arrow_cast(to_timestamp('2020-01-02 01:01:11.1234567890Z'), '          Timestamp        (Nanosecond,      None               ) ');
   Error during planning: Unsupported type '          Timestamp        (Nanosecond,      None               ) '. Must be a supported arrow type name such as 'Int32' or 'Timestamp(Nanosecond, None)'. Error checking trailing content after parsing 'Timestamp(Nanosecond, None)'
   ❯
   ```
   
   The parser is very tolerant of whitespace in the constant string containing the type unless the whitespace is at the very end, unsure if this is intended


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