paleolimbot commented on PR #15278:
URL: https://github.com/apache/arrow/pull/15278#issuecomment-1380848916

   It looks like this fix worked for the reprex on the original issue:
   
   ``` r
   library(arrow, warn.conflicts = FALSE)
   packageVersion("arrow")
   #> [1] '10.0.1.100000401'
   
   # create a FileSystemDataset object
   filename <- here::here("tmp")
   write_dataset(cars, filename, format = "feather")
   ds <- open_dataset(filename, format = "feather")
   
   # Open a RecordBatchReader for this Dataset
   scanner <- ScannerBuilder$create(ds)$BatchSize(batch_size = 4)$Finish()
   reader <- scanner$ToRecordBatchReader()
   
   batch_num <- 1
   while(!is.null(batch <- reader$read_next_batch())) {
     batch_num <- batch_num + 1
   }
   
   # Confirm that we can't delete the file yet
   unlink(filename, recursive = TRUE)
   file.exists(filename)
   #> [1] TRUE
   
   # This is the method added by this PR
   reader$.unsafe_delete()
   
   unlink(filename, recursive = TRUE)
   file.exists(filename) # should be FALSE if the fix worked
   #> [1] FALSE
   ```
   
   <sup>Created on 2023-01-12 with [reprex 
v2.0.2](https://reprex.tidyverse.org)</sup>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to