Skip to content

Commit

Permalink
read_parquet() only reading one parquet file, and gains a as_tibble
Browse files Browse the repository at this point in the history
… argument
  • Loading branch information
romainfrancois committed Jan 3, 2019
1 parent e936b44 commit 7d6e64d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
14 changes: 10 additions & 4 deletions r/R/parquet.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@

#' Read parquet file from disk
#'
#' @param files a vector of filenames
#' @param file a file path
#' @param as_tibble should the [arrow::Table][arrow__Table] be converted to a tibble.
#' @param ... currently ignored
#'
#' @importFrom purrr map_dfr
#' @return a [arrow::Table][arrow__Table], or a data frame if `as_tibble` is `TRUE`.
#'
#' @export
read_parquet <- function(files) {
map_dfr(files, ~as_tibble(shared_ptr(`arrow::Table`, read_parquet_file(f))))
read_parquet <- function(file, as_tibble = TRUE, ...) {
tab <- shared_ptr(`arrow::Table`, read_parquet_file(f))
if (isTRUE(as_tibble)) {
tab <- as_tibble(tab)
}
tab
}
11 changes: 9 additions & 2 deletions r/man/read_parquet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7d6e64d

Please sign in to comment.