-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
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)Reporter: Nicola Crane / @thisisnic
Assignee: David Li / @lidavidm
Related issues:
- [R] unsupported timestamp cast in CSV with tz element (is duplicated by)
- [C++] Implement cast from date32[day] to utf8 (relates to)
- [C++] Support cast from timestamp[UTC] to string on Windows (is related to)
- [C++][CSV] Timestamp parsing should accept any valid ISO 8601 without requiring custom parse strings (is related to)
PRs and other links:
Note: This issue was originally created as ARROW-14231. Please see the migration documentation for further details.