abfleishman opened a new issue, #39191:
URL: https://github.com/apache/arrow/issues/39191

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   The [arrow R package claims to support the `stringr::str_replace_all()` 
function](https://arrow.apache.org/docs/dev/r/reference/acero.html#stringr), 
however, it does not support using a vector of pattern/replacements as [the 
function says it 
should.](https://stringr.tidyverse.org/reference/str_replace.html)
   ```r
   library(arrow)
   #> 
   #> Attaching package: 'arrow'
   #> The following object is masked from 'package:utils':
   #> 
   #>     timestamp
   library(dplyr)
   #> 
   #> Attaching package: 'dplyr'
   #> The following objects are masked from 'package:stats':
   #> 
   #>     filter, lag
   #> The following objects are masked from 'package:base':
   #> 
   #>     intersect, setdiff, setequal, union
   library(stringr)
   dat<-data.frame(common_name=c("Cobalt-rumped Parrotlet", 
                                 "Striped Woodcreeper", 
                                 "Allard's Ground Cricket",
                                 "Southern Double-collared Sunbird"))
   dat_arrow<-arrow_table(dat)
   
   # if working with a normal data.frame the following code works
   dat_df<-dat %>% 
       mutate(common_name_clean = str_replace_all(common_name, c(" |-"="_", "'" 
= "")))
   
   dat_df
   #>                        common_name                common_name_clean
   #> 1          Cobalt-rumped Parrotlet          Cobalt_rumped_Parrotlet
   #> 2              Striped Woodcreeper              Striped_Woodcreeper
   #> 3          Allard's Ground Cricket           Allards_Ground_Cricket
   #> 4 Southern Double-collared Sunbird Southern_Double_collared_Sunbird
   
   #but if working with an arrow data.frame it says I have to collect first
   dat_arrow<-dat_arrow%>% 
       mutate(common_name_clean = str_replace_all(common_name, c(" |-"="_", "'" 
= "")))
   #> Warning: Expression str_replace_all(common_name, c(` |-` = "_", `'` = 
"")) not
   #> supported in Arrow; pulling data into R
   Created on 2023-12-11 with reprex v2.0.2
   ```
   
   ### Component(s)
   
   R


-- 
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