Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
The R code below creates a simple data frame containing a datetime (timestamp) object, but when I try to save this to disk I get an "unsupported cast" error.
library(arrow) df <- tibble::tibble(datetime = as.POSIXct(c("2020-07-20 16:20", NA), tz = "UTC")) write_csv_arrow(df, "df.csv") # Error: NotImplemented: Unsupported cast from timestamp[us, tz=UTC] to utf8 using function cast_string # /home/nic2/arrow/cpp/src/arrow/compute/function.cc:215 DispatchBest(&inputs) # /home/nic2/arrow/cpp/src/arrow/compute/cast.cc:229 Cast(Datum(value), to_type, options, ctx) # /home/nic2/arrow/cpp/src/arrow/csv/writer.cc:101 compute::Cast(data, utf8(), compute::CastOptions(), &ctx) # /home/nic2/arrow/cpp/src/arrow/csv/writer.cc:395 column_populators_[col]->UpdateRowLengths(*batch.column(col), offsets_.data()) # /home/nic2/arrow/cpp/src/arrow/csv/writer.cc:324 TranslateMinimalBatch(*batch) # /home/nic2/arrow/cpp/src/arrow/csv/writer.cc:434 writer->WriteTable(table)
Attachments
Issue Links
- is duplicated by
-
ARROW-15105 [R] unsupported timestamp cast in CSV with tz element
- Closed
- is related to
-
ARROW-14643 [C++] Support cast from timestamp[UTC] to string on Windows
- Open
-
ARROW-13625 [C++][CSV] Timestamp parsing should accept any valid ISO 8601 without requiring custom parse strings
- Resolved
- relates to
-
ARROW-12540 [C++] Implement cast from date32[day] to utf8
- Resolved
- links to
Issue resolved by pull request 11328
https://github.com/apache/arrow/pull/11328