R/parquet_readr.R

Defines functions parquet_readr

Documented in parquet_readr

#' Read a multi-part parquet file in as a data.frame
#'
#' @export
#' @param path The path to the directory where the file is stored.
#' @param verbose Used for debugging the path string.
#'
#' @return A single dataframe of your multi-part parquet.
#'
#' @examples \dontrun{
#' # parquet_readr(path=path/to/your/parquet.parquet)
#'
#' }
#'

parquet_readr = function(path,verbose=FALSE) {
  . = NULL

  path_string = paste0(path,"/part-*.parquet")

  if(verbose) print(Sys.glob(path_string))

  df = Sys.glob(path_string) %>%
    purrr::map(~ arrow::read_parquet(.x)) %>%
    do.call("rbind",.)

  return(df)
}

Try the parqr package in your browser

Any scripts or data that you put into this service are public.

parqr documentation built on July 15, 2021, 9:06 a.m.