R: ParquetFileReader class

ParquetFileReader {arrow} | R Documentation

## ParquetFileReader class

### Description

This class enables you to interact with Parquet files.

### Factory

The `ParquetFileReader$create()` factory method instantiates the object and takes the following arguments:

- `file` A character file name, raw vector, or Arrow file connection object (e.g. `RandomAccessFile`).

- `props` Optional ParquetReaderProperties

- `mmap` Logical: whether to memory-map the file (default `TRUE`)

- `...` Additional arguments, currently ignored

### Methods

- `$ReadTable(col_select)`: get an `arrow::Table` from the file, possibly with columns filtered by a character vector of column names or a `tidyselect` specification.

- `$GetSchema()`: get the `arrow::Schema` of the data in the file

### Examples

    f <- system.file("v0.7.1.parquet", package="arrow")
    pq <- ParquetFileReader$create(f)
    pq$GetSchema()
    if (codec_is_available("snappy")) {
      # This file has compressed data columns
      tab <- pq$ReadTable(starts_with("c"))
      tab$schema
    }

[Package arrow version 0.17.1 Index]