Skip to contents

Native Parquet reader: no nanoparquet, no arrow. Handles the v1 format with PLAIN, RLE and dictionary encodings, Snappy or no compression. Flat columns and three-level LIST columns of a primitive type are decoded; a LIST column comes back as a list column (class AsIs) holding one vector per row, NULL for a null list. Other nesting is refused.

Usage

morie_read_parquet(path, columns = NULL)

Arguments

path

Path to a .parquet file.

columns

Optional character vector of column names to decode; the rest are skipped entirely.

Value

A data.frame.

Examples

if (requireNamespace("arrow", quietly = TRUE)) {
  df <- data.frame(a = 1:3, b = c("x", "y", "z"), stringsAsFactors = FALSE)
  p <- tempfile(fileext = ".parquet")
  morie_write_parquet(df, p)
  morie_read_parquet(p)
}
#>   a b
#> 1 1 x
#> 2 2 y
#> 3 3 z