[
https://issues.apache.org/jira/browse/ARROW-13022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17424542#comment-17424542
]
Jameel Alsalam commented on ARROW-13022:
----------------------------------------
Is it expected behavior that the lubridate functions like year() are
implemented for datetimes but not dates? (or perhaps this is a windows-specific
issue I'm having, though I don't think it would be related to timezones)
``` r
library(arrow)
#>
#> Attaching package: 'arrow'
#> The following object is masked from 'package:utils':
#>
#> timestamp
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(tibble))
library(lubridate, warn.conflicts = FALSE)
test_date <- as.POSIXct("2017-01-01 00:00:12.3456789", tz = "")
test_df <- tibble::tibble(
datetime = c(test_date, NA),
date = c(as.Date("2017-01-01"), NA)
)
ar <- Table$create(test_df)
ar %>%
mutate(yr_dt = year(datetime)) %>%
pull(yr_dt)
#> [1] 2017 NA
ar %>%
mutate(yr_d = year(date)) %>%
pull(yr_d)
#> Error: NotImplemented: Function year has no kernel matching input types
(array[date32[day]])
ar %>%
mutate(mo_dt = month(datetime)) %>%
pull(mo_dt)
#> [1] 1 NA
ar %>%
mutate(mo_d = month(date)) %>%
pull(mo_d)
#> Error: NotImplemented: Function month has no kernel matching input types
(array[date32[day]])
```
<sup>Created on 2021-10-05 by the [reprex
package](https://reprex.tidyverse.org) (v2.0.1)</sup>
<details style="margin-bottom:10px;">
<summary>
Session info
</summary>
``` r
sessioninfo::session_info()
#> - Session info
---------------------------------------------------------------
#> setting value
#> version R version 4.0.5 (2021-03-31)
#> os Windows 10 x64
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_United States.1252
#> ctype English_United States.1252
#> tz America/New_York
#> date 2021-10-05
#>
#> - Packages
-------------------------------------------------------------------
#> package * version date lib source
#> arrow * 5.0.0.2 2021-09-05 [1] CRAN (R 4.0.5)
#> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.5)
#> bit 4.0.4 2020-08-04 [1] CRAN (R 4.0.5)
#> bit64 4.0.5 2020-08-30 [1] CRAN (R 4.0.5)
#> cli 3.0.1 2021-07-17 [1] CRAN (R 4.0.5)
#> crayon 1.4.1 2021-02-08 [1] CRAN (R 4.0.5)
#> DBI 1.1.1 2021-01-15 [1] CRAN (R 4.0.5)
#> digest 0.6.27 2020-10-24 [1] CRAN (R 4.0.5)
#> dplyr * 1.0.7 2021-06-18 [1] CRAN (R 4.0.5)
#> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.0.5)
#> evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.5)
#> fansi 0.5.0 2021-05-25 [1] CRAN (R 4.0.5)
#> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.0.5)
#> fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.5)
#> generics 0.1.0 2020-10-31 [1] CRAN (R 4.0.5)
#> glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.5)
#> highr 0.9 2021-04-16 [1] CRAN (R 4.0.5)
#> htmltools 0.5.2 2021-08-25 [1] CRAN (R 4.0.5)
#> knitr 1.34 2021-09-09 [1] CRAN (R 4.0.5)
#> lifecycle 1.0.0 2021-02-15 [1] CRAN (R 4.0.5)
#> lubridate * 1.7.10 2021-02-26 [1] CRAN (R 4.0.5)
#> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.0.5)
#> pillar 1.6.2 2021-07-29 [1] CRAN (R 4.0.5)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.5)
#> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.5)
#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.0.5)
#> Rcpp 1.0.7 2021-07-07 [1] CRAN (R 4.0.5)
#> reprex 2.0.1 2021-08-05 [1] CRAN (R 4.0.5)
#> rlang 0.4.11 2021-04-30 [1] CRAN (R 4.0.5)
#> rmarkdown 2.11 2021-09-14 [1] CRAN (R 4.0.5)
#> rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.0.5)
#> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.5)
#> stringi 1.7.4 2021-08-25 [1] CRAN (R 4.0.5)
#> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.5)
#> tibble * 3.1.4 2021-08-25 [1] CRAN (R 4.0.5)
#> tidyselect 1.1.1 2021-04-30 [1] CRAN (R 4.0.5)
#> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.0.5)
#> vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.0.5)
#> withr 2.4.2 2021-04-18 [1] CRAN (R 4.0.5)
#> xfun 0.26 2021-09-14 [1] CRAN (R 4.0.5)
#> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.5)
#>
#> [1] C:/Users/jalsal02/R/win-library/4.0
#> [2] C:/Program Files/R/R-4.0.5/library
```
</details>
> [R] bindings for lubridate's year, isoyear, quarter, month, day, wday, yday,
> isoweek, hour, minute, and second functions
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: ARROW-13022
> URL: https://issues.apache.org/jira/browse/ARROW-13022
> Project: Apache Arrow
> Issue Type: Improvement
> Components: R
> Reporter: Nicola Crane
> Assignee: Nicola Crane
> Priority: Major
> Labels: pull-request-available
> Fix For: 5.0.0
>
> Time Spent: 6h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)