'Parquet' is a columnar storage file format. This function enables you to read Parquet files into R.

read_parquet(
  file,
  col_select = NULL,
  as_data_frame = TRUE,
  props = ParquetReaderProperties$create(),
  ...
)

Arguments

file

A character file name, raw vector, or an Arrow input stream

col_select

A character vector of column names to keep, as in the "select" argument to data.table::fread(), or a tidy selection specification of columns, as used in dplyr::select().

as_data_frame

Should the function return a data.frame or an arrow::Table?

props

ParquetReaderProperties

...

Additional arguments passed to ParquetFileReader$create()

Value

A arrow::Table, or a data.frame if as_data_frame is TRUE.

Examples

# \donttest{ df <- read_parquet(system.file("v0.7.1.parquet", package="arrow")) head(df)
#> # A tibble: 6 x 11 #> carat cut color clarity depth table price x y z `__index_level_… #> <dbl> <chr> <chr> <chr> <dbl> <dbl> <int> <dbl> <dbl> <dbl> <int64> #> 1 0.23 Ideal E SI2 61.5 55 326 3.95 3.98 2.43 0 #> 2 0.21 Prem… E SI1 59.8 61 326 3.89 3.84 2.31 1 #> 3 0.23 Good E VS1 56.9 65 327 4.05 4.07 2.31 2 #> 4 0.290 Prem… I VS2 62.4 58 334 4.2 4.23 2.63 3 #> 5 0.31 Good J SI2 63.3 58 335 4.34 4.35 2.75 4 #> 6 0.24 Very… J VVS2 62.8 57 336 3.94 3.96 2.48 5
# }