Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
9.0.0
Description
It is expected that dplyr::compute() will perform the calculation on the arrow dplyr query and convert it to a Table, but it does not seem to work correctly for grouped arrow dplyr queries and does not result in a Table.
mtcars |> arrow::arrow_table() |> dplyr::group_by(cyl) |> dplyr::compute() |> class() #> [1] "arrow_dplyr_query" mtcars |> arrow::arrow_table() |> dplyr::group_by(cyl) |> dplyr::ungroup() |> dplyr::compute() |> class() #> [1] "Table" "ArrowTabular" "ArrowObject" "R6"
as_arrow_table() works fine.
mtcars |> arrow::arrow_table() |> dplyr::group_by(cyl) |> class() #> [1] "arrow_dplyr_query" mtcars |> arrow::arrow_table() |> dplyr::group_by(cyl) |> dplyr::compute() |> class() #> [1] "arrow_dplyr_query" mtcars |> arrow::arrow_table() |> dplyr::group_by(cyl) |> dplyr::collect(FALSE) |> class() #> [1] "arrow_dplyr_query" mtcars |> arrow::arrow_table() |> dplyr::group_by(cyl) |> arrow::as_arrow_table() |> class() #> [1] "Table" "ArrowTabular" "ArrowObject" "R6"
It seems to revert to arrow dplyr query in the following line.
https://github.com/apache/arrow/blob/7cfdfbb0d5472f8f8893398b51042a3ca1dd0adf/r/R/dplyr-collect.R#L73-L75
Attachments
Issue Links
- is related to
-
ARROW-17737 [R] Groups before conversion to a Table must not be restored after `collect()`
- Resolved
- links to