Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ParquetFileReader

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 ParquetArrowReaderProperties

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

  • ... Additional arguments, currently ignored

Methods

  • $ReadTable(column_indices): get an arrow::Table from the file. The optional column_indices= argument is a 0-based integer vector indicating which columns to retain.

  • $ReadRowGroup(i, column_indices): get an arrow::Table by reading the ith row group (0-based). The optional column_indices= argument is a 0-based integer vector indicating which columns to retain.

  • $ReadRowGroups(row_groups, column_indices): get an arrow::Table by reading several row groups (0-based integers). The optional column_indices= argument is a 0-based integer vector indicating which columns to retain.

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

  • $ReadColumn(i): read the ith column (0-based) as a ChunkedArray.

Active bindings

  • $num_rows: number of rows.

  • $num_columns: number of columns.

  • $num_row_groups: number of row groups.

Examples

## Not run: 
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()
  tab$schema
}

## End(Not run)

arrow

Integration to 'Apache' 'Arrow'

v4.0.0.1
Apache License (>= 2.0)
Authors
Neal Richardson [aut, cre], Ian Cook [aut], Jonathan Keane [aut], Romain François [aut] (<https://orcid.org/0000-0002-2444-4226>), Jeroen Ooms [aut], Javier Luraschi [ctb], Jeffrey Wong [ctb], Apache Arrow [aut, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.