Learn R Programming

rcdf (version 0.1.4)

write_parquet: Write Parquet file with optional encryption

Description

This function writes a dataset to a Parquet file. If an encryption key is provided, the data will be encrypted before writing. Otherwise, the function writes the data as a regular Parquet file without encryption.

Usage

write_parquet(data, path, ..., encryption_key = NULL)

Value

None. The function writes the data to a Parquet file at the specified path.

Arguments

data

A data frame or tibble to write to a Parquet file.

path

The file path where the Parquet file will be written.

...

Additional arguments passed to arrow::write_parquet() if no encryption key is provided.

encryption_key

A list containing aes_key and aes_iv. If provided, the data will be encrypted using AES before writing to Parquet.

Examples

Run this code
if (FALSE) {
data <- mtcars
key <- "rppqM5CuEqotys4wQq/g7xh6wpIjRozcAIbI9sagwKE="

temp_dir <- tempdir()

rcdf::write_parquet(
  data = data,
  path = file.path(temp_dir, "mtcars.parquet"),
  encryption_key = key
)
}

Run the code above in your browser using DataLab