Skip to content

[help] How does format = "file" work for nested directories? #1257

Closed Answered by rsangole
rsangole asked this question in Help
Discussion options

You must be logged in to vote

I suppose I answered my own question with an experiment...

library(targets)
list(
  tar_target(
    mtcars_out_1,{
      tibble::as_tibble(mtcars) |>
        dplyr::group_by(cyl) |>
        arrow::write_dataset("folder_out")
      here::here("folder_out")
    },
    format = "file"
  ),
  tar_target(
    mtcars_out_2,{
      tibble::as_tibble(mtcars) |>
        dplyr::group_by(cyl) |>
        arrow::write_dataset("file_out")
      fs::dir_ls("file_out", recurse = TRUE, type = "file")
    },
    format = "file"
  )
)

Both approaches seem to work right.

Is there one approach more performant than the other, esp for v-large datasets?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wlandau
Comment options

Answer selected by rsangole
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants