Skip to content

[R]: pull on a grouped query returns the wrong column. #43153

@jonkeane

Description

@jonkeane

Describe the bug, including details regarding any error messages, version, and platform.

It looks like pull(disp) here is actually getting the data from gear. I've tried this with both released / from CRAN arrow as well as nightlies.

library(arrow, warn.conflicts = FALSE, quietly = TRUE)
library(dplyr, warn.conflicts = FALSE, quietly = TRUE)

as_arrow <- as_arrow_table(mtcars) |> 
  group_by(gear, am) |>
  pull(disp)
as_arrow
#>  [1] 4 4 4 3 3 3 3 4 4 4 4 3 3 3 3 3 3 4 4 4 3 3 3 3 3 4 5 5 5 5 5 4
as_dplyr <-mtcars |> 
  group_by(gear, am) |>
  pull(disp)
as_dplyr
#>  [1] 160.0 160.0 108.0 258.0 360.0 225.0 360.0 146.7 140.8 167.6 167.6 275.8
#> [13] 275.8 275.8 472.0 460.0 440.0  78.7  75.7  71.1 120.1 318.0 304.0 350.0
#> [25] 400.0  79.0 120.3  95.1 351.0 145.0 301.0 121.0
as_arrow == as_dplyr
#>  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
setdiff(as_arrow, as_dplyr)
#> [1] 4 3 5

but without grouping

as_arrow <- as_arrow_table(mtcars) |> 
  pull(disp)
as_arrow
#>  [1] 160.0 160.0 108.0 258.0 360.0 225.0 360.0 146.7 140.8 167.6 167.6 275.8
#> [13] 275.8 275.8 472.0 460.0 440.0  78.7  75.7  71.1 120.1 318.0 304.0 350.0
#> [25] 400.0  79.0 120.3  95.1 351.0 145.0 301.0 121.0
as_dplyr <-mtcars |> 
  pull(disp)
as_dplyr
#>  [1] 160.0 160.0 108.0 258.0 360.0 225.0 360.0 146.7 140.8 167.6 167.6 275.8
#> [13] 275.8 275.8 472.0 460.0 440.0  78.7  75.7  71.1 120.1 318.0 304.0 350.0
#> [25] 400.0  79.0 120.3  95.1 351.0 145.0 301.0 121.0
as_arrow == as_dplyr
#>  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [31] TRUE TRUE
setdiff(as_arrow, as_dplyr)
#> numeric(0)

Component(s)

R

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions