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

Dewey Dunnington commented on ARROW-18263:
------------------------------------------

I think POSIXlt gets converted as an extension type (before I touched this code 
I think it was converted as a data.frame with R-level metadata in the schema):

{code:R}
arrow::as_arrow_array(as.POSIXlt(Sys.time()))$type
#> VctrsExtensionType
#> POSIXlt of length 0
vctrs::vec_ptype(as.POSIXlt(Sys.time()))
#> POSIXlt of length 0
{code}

The length 0 thing is the implementation of `VctrsExtensionType$ToString()`, 
which could definitely use some help!

> [R] Error when trying to write POSIXlt data to CSV
> --------------------------------------------------
>
>                 Key: ARROW-18263
>                 URL: https://issues.apache.org/jira/browse/ARROW-18263
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: R
>            Reporter: Nicola Crane
>            Priority: Major
>
> I get an error trying to write a tibble of POSIXlt data to a file.  The error 
> is a bit misleading as it refers to the column being of length 0.
> {code:r}
> posixlt_data <- tibble::tibble(x = as.POSIXlt(Sys.time()))
> write_csv_arrow(posixlt_data, "posixlt_data.csv")
> {code}
> {code:r}
> Error: Invalid: Unsupported Type:POSIXlt of length 0
> {code}
> See also:
> {code:r}
> arrow_table(posixlt_data)
> {code}
> {code:r}
> Table
> 2 rows x 2 columns
> $x <POSIXlt of length 0>
> $y <int32>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to