You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "assignUser (via GitHub)" <gi...@apache.org> on 2024/07/27 01:38:51 UTC

Re: [I] Unable to filter a factor column in a Dataset using `%in%` [arrow]

assignUser commented on issue #43440:
URL: https://github.com/apache/arrow/issues/43440#issuecomment-2253698541

   You can solve this by casting the dictionary encoded column to string: `mutate(x = cast(x, string()))` and back to dictionary to get a factor out when collecting: 
   ```r
   d3 <- arrow::open_dataset(temp_file, format = "arrow") |> mutate(x = cast(x, string())) |>
             dplyr::filter(x %in% "a") |> mutate(x = cast(x, dictionary())) |> collect()`
   ```
   I am of two minds, either we are missing a binding or this is your sign that `%in%` is not the right tool for the job (at least for single values) :grinning: 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org