[R] Permission error on Windows when deleting file previously accessed with open_dataset

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major
    • None
    • Affects Version/s: 7.0.0
    • Component/s: R
    • None

      On Windows this fails:

      library(arrow)
      
      write_dataset(iris, "test_dataset")
      
      # Original example was with DuckDB, but that's not necessarily the issue
      # con <- open_dataset("test_dataset") |> to_duckdb()
      con <- open_dataset("test_dataset")$NewScan()$Finish()$ToRecordBatchReader()
      
      file.remove("test_dataset/part-0.parquet")
      #> Warning in file.remove("test_dataset/part-0.parquet"): cannot remove file
      #> 'test_dataset/part-0.parquet', reason 'Permission denied'
      #> [1] FALSE
      

      But on MacOS it does not:

      library(arrow)
      
      write_dataset(iris, "test_dataset")
      
      # Original example was with DuckDB, but that's not necessarily the issue
      # con <- open_dataset("test_dataset") |> to_duckdb()
      con <- open_dataset("test_dataset")$NewScan()$Finish()$ToRecordBatchReader()
      
      file.remove("test_dataset/part-0.parquet")
      #> [1] TRUE
      

            Assignee:
            Unassigned
            Reporter:
            Will Jones
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: