Skip to content

[R] cannot collect multiple times after passing to_arrow() and collect() #44069

@abduazizR

Description

@abduazizR

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

I am using the arrow package in arrow and I am facing an issue when I try to collect data

Here is a reproducible example

library(duckdb)
#> Warning: package 'duckdb' was built under R version 4.4.1
#> Loading required package: DBI
library(arrow)
#> Warning: package 'arrow' was built under R version 4.4.1
#> 
#> Attaching package: 'arrow'
#> The following object is masked from 'package:utils':
#> 
#>     timestamp
library(tidyverse)

# Example
x <- iris |> to_duckdb() |> to_arrow()

# Collect first time (success)
x |> collect()
#> # A tibble: 150 × 5
#>    Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#>           <dbl>       <dbl>        <dbl>       <dbl> <chr>  
#>  1          5.1         3.5          1.4         0.2 setosa 
#>  2          4.9         3            1.4         0.2 setosa 
#>  3          4.7         3.2          1.3         0.2 setosa 
#>  4          4.6         3.1          1.5         0.2 setosa 
#>  5          5           3.6          1.4         0.2 setosa 
#>  6          5.4         3.9          1.7         0.4 setosa 
#>  7          4.6         3.4          1.4         0.3 setosa 
#>  8          5           3.4          1.5         0.2 setosa 
#>  9          4.4         2.9          1.4         0.2 setosa 
#> 10          4.9         3.1          1.5         0.1 setosa 
#> # ℹ 140 more rows


# Collct second time => empty tibble
x |> collect()
#> # A tibble: 0 × 5
#> # ℹ 5 variables: Sepal.Length <dbl>, Sepal.Width <dbl>, Petal.Length <dbl>,
#> #   Petal.Width <dbl>, Species <chr>

Created on 2024-09-11 with reprex v2.1.1

Component(s)

R

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions