dragosmg opened a new pull request #12433:
URL: https://github.com/apache/arrow/pull/12433


   The following will be supported in arrow (`base::as.Date()` included to show 
the difference to `date()`, but not supported):
   ``` r
   suppressPackageStartupMessages(library(dplyr))
   suppressPackageStartupMessages(library(lubridate))
   
   df <- tibble(a = as.POSIXct("2012-03-26 23:12:13", tz = "America/New_York"))
   
   df %>%
     mutate(
       a_date = date(a),
       a_date_base = as.Date(a))
   #> # A tibble: 1 × 3
   #>   a                   a_date     a_date_base
   #>   <dttm>              <date>     <date>     
   #> 1 2012-03-26 23:12:13 2012-03-26 2012-03-27
   ```
   
   ``` r
   suppressPackageStartupMessages(library(arrow))
   suppressPackageStartupMessages(library(dplyr))
   suppressPackageStartupMessages(library(lubridate))
   
   df <- tibble(a = as.POSIXct("2012-03-26 23:12:13", tz = "America/New_York"))
   df %>% 
     arrow_table() %>% 
     mutate(
       a_date = date(a)
     ) %>% 
     collect()
   #> # A tibble: 1 × 2
   #>   a                   a_date    
   #>   <dttm>              <date>    
   #> 1 2012-03-26 23:12:13 2012-03-26
   ```
   
   <sup>Created on 2022-02-15 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