[
https://issues.apache.org/jira/browse/ARROW-18250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17629705#comment-17629705
]
Nicola Crane commented on ARROW-18250:
--------------------------------------
Thanks for reporting this [~lucasmation]! Internally this function maps to the
same Acero compute function as is mapped to {{base::gsub()}} so the cause here
is likely to be the same as ARROW-18202.
> [R] mutate(x2=x %>% str_replace('^ s*$',NA_character_)) Does not replicate
> behaviour of R
> ------------------------------------------------------------------------------------------
>
> Key: ARROW-18250
> URL: https://issues.apache.org/jira/browse/ARROW-18250
> Project: Apache Arrow
> Issue Type: Bug
> Components: R
> Reporter: Lucas Mation
> Priority: Minor
>
> {code:r}
> q <- data.table(x=c('','1','2'))
> q %>% write_dataset('q')
> #in R
> q %>% mutate(x2=x %>% str_replace('^
> s*$',NA_character_))
> x x2
> 1: <NA>
> 2: 1 1
> 3: 2 2
> #in arrow
> q2 <- 'q' %>% open_dataset %>% mutate(x2=x %>% str_replace('^
> s*$',NA_character_)) %>% collect
> q2
> x x2
> 1:
> 2: 1 1
> 3: 2 2
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)