paleolimbot commented on pull request #11592:
URL: https://github.com/apache/arrow/pull/11592#issuecomment-957997188


   Ok! I think this is cleaner...I had incorrectly included TIME32 and TIME64 
with TIMESTAMP as well. Does DATE64 map back to POSIXct?
   
   I think it's best to leave POSIXlt alone, since it maps to a `struct<...>` 
and didn't work with `strftime()` anyway:
   
   ``` r
   library(arrow, warn.conflicts = FALSE)
   library(dplyr, warn.conflicts = FALSE)
   
   RecordBatch$create(x = as.POSIXct(as.Date("2000-01-01"))) %>% 
     mutate(y = strftime(x, "%Y-%M-%d")) %>% 
     collect()
   #> # A tibble: 1 × 2
   #>   x                   y         
   #>   <dttm>              <chr>     
   #> 1 2000-01-01 00:00:00 2000-00-01
   
   RecordBatch$create(x = as.POSIXlt(as.Date("2000-01-01"))) %>% 
     mutate(y = strftime(x, "%Y-%M-%d")) %>% 
     collect()
   #> Error: NotImplemented: Function strftime has no kernel matching input 
types (array[struct<sec: double, min: int32, hour: int32, mday: int32, mon: 
int32, year: int32, wday: int32, yday: int32, isdst: int32>])
   #> 
/Users/deweydunnington/Desktop/rscratch/arrow/cpp/src/arrow/compute/exec/expression.cc:340
  call.function->DispatchBest(&descrs)
   #> 
/Users/deweydunnington/Desktop/rscratch/arrow/cpp/src/arrow/compute/exec/project_node.cc:67
  expr.Bind(*inputs[0]->output_schema())
   ```
   
   <sup>Created on 2021-11-02 by the [reprex 
package](https://reprex.tidyverse.org) (v2.0.1)</sup>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to