Skip to content

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

Closed

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

Activity

  1. changed the title [-]`pull` on a grouped query returns the wrong column.[/-] [+][R]: `pull` on a grouped query returns the wrong column.[/+] on Jul 5, 2024
  2. added a commit that references this issue on Jul 7, 2024
  3. jonkeane commented on Jul 7, 2024

    @jonkeane
    MemberAuthor

    Issue resolved by pull request 43172
    #43172

  4. added this to the 18.0.0 milestone on Jul 7, 2024
  5. added a commit that references this issue on Jul 18, 2024
  6. added
    Critical Fix
    on Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Component: RCritical FixType: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions