You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2021/09/15 18:33:00 UTC

[jira] [Commented] (ARROW-14006) [C++][Python] Support cast of naive timestamps to strings

    [ https://issues.apache.org/jira/browse/ARROW-14006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17415683#comment-17415683 ] 

Joris Van den Bossche commented on ARROW-14006:
-----------------------------------------------

Casting to strings itself works:

{code}
>>> pa.array([1], pa.timestamp("ns")).cast("string")
<pyarrow.lib.StringArray object at 0x7f75eb76c820>
[
  "1970-01-01 00:00:00.000000001"
]
{code}

so it might rather be something in the CSV writer that prevents this?

> [C++][Python] Support cast of naive timestamps to strings
> ---------------------------------------------------------
>
>                 Key: ARROW-14006
>                 URL: https://issues.apache.org/jira/browse/ARROW-14006
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++, Python
>            Reporter: Jorge Leitão
>            Priority: Minor
>              Labels: kernel, types
>
> When writing to CSV, timestamp columns error with cast_string not supporting timestamp[ns]. It would be nice to support this cast this via e.g. [ISO 8601|https://en.wikipedia.org/wiki/ISO_8601].
> This happened when trying to use postgres' {{COPY ... FROM STDIN WITH CSV}}, which is a method to bulk load data into postgres.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)