Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
In the course of updating documentation, I noticed that it is possible to create an Arrow array of POSIXlt objects from R, but not a scalar.
https://github.com/apache/arrow/pull/14514#discussion_r1016078081
This works:
tm <- as.POSIXlt(c(Sys.time(), Sys.time())) arrow::Array$create(tm)
This fails:
arrow::Scalar$create(as.POSIXlt(Sys.time()))
It's possible to manually convert a POSIXlt object to a struct scalar like this:
df <- as.data.frame(unclass(as.POSIXlt(Sys.time()))) arrow::Scalar$create(df, type = struct( sec = float32(), min = int32(), hour = int32(), mday = int32(), mon = int32(), year = int32(), wday = int32(), yday = int32(), isdst = int32(), zone = utf8(), gmtoff = int32() ))
although this does not seem precisely the same as the behaviour of Array$create() which creates an extension type?
It was unclear to us (thisisnic and myself) whether the current behaviour was desirable, so it seemed sensible to open an issue!
Related issue:
Attachments
Issue Links
- links to