read_parquet {nanoparquet} | R Documentation |
Read a Parquet file into a data frame
Description
Converts the contents of the named Parquet file to a R data frame.
Usage
read_parquet(file, col_select = NULL, options = parquet_options())
Arguments
file |
Path to a Parquet file. It may also be an R connection,
in which case it first reads all data from the connection, writes
it into a temporary file, then reads the temporary file, and
deletes it. The connection might be open, it which case it must be
a binary connection. If it is not open, then |
col_select |
Columns to read. It can be a numeric vector of column
indices, or a character vector of column names. It is an error to
select the same column multiple times. The order of the columns in
the result is the same as the order in |
options |
Nanoparquet options, see |
Value
A data.frame
with the file's contents.
See Also
See write_parquet()
to write Parquet files,
nanoparquet-types for the R <-> Parquet type mapping.
See read_parquet_info()
, for general information,
read_parquet_schema()
for information about the
columns, and read_parquet_metadata()
for the complete metadata.
Examples
file_name <- system.file("extdata/userdata1.parquet", package = "nanoparquet")
parquet_df <- nanoparquet::read_parquet(file_name)
print(str(parquet_df))