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.
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
data <- mtcars
key <- "5bddd0ea4ab48ed5e33b1406180d68158aa255cf3f368bdd4744abc1a7909ead"
iv <- "7D3EF463F4CCD81B11B6EC3230327B2D"
temp_dir <- tempdir()
rcdf::write_parquet(
data = data,
path = file.path(temp_dir, "mtcars.parquet"),
encryption_key = list(aes_key = key, aes_iv = iv)
)
unlink(file.path(temp_dir, "mtcars.parquet"), force = TRUE)