MyNixOS website logo
Description

Convert Files to Parquet Format.

Collection of functions to get files in parquet format. Parquet is a columnar storage file format <https://parquet.apache.org/>. The files to convert can be of several formats ("csv", "RData", "rds", "RSQLite", "json", "ndjson", "SAS", "SPSS"...).

GitHub toplanguage version cranlogs Downloads R checkstatus codecov CodeFactor

:package: Package parquetize

R package that allows to convert databases of different formats (csv, SAS, SPSS, Stata, rds, sqlite, JSON, ndJSON) to parquet format in a same function.

Installation

To install parquetize from CRAN :

install.packages("parquetize")

Or alternatively to install the development version from GitHub :

remotes::install_github("ddotta/parquetize")

Then to load it :

library(parquetize)

Why this package ?

This package is a simple wrapper of some very useful functions from the haven, readr, jsonlite, RSQLite and arrow packages.

While working, I realized that I was often repeating the same operation when working with parquet files :

  • I import the file in R with {haven}, {jsonlite}, {readr}, {DBI} or {RSQLite}.
  • And I export the file in parquet format

As a fervent of the DRY principle (don't repeat yourself) the exported functions of this package make my life easier and execute these operations within the same function.

The last benefit of using package {parquetize} is that its functions allow to create single parquet files or partitioned files depending on the arguments chosen in the functions.

  • csv_to_parquet()
    • The other benefit of this function is that it allows you to convert csv or txt files whether they are stored locally or available on the internet directly to csv/txt format or inside a zip.
  • json_to_parquet()
    • The other benefit of this function is that it handles JSON and ndJSON files in a same function. There is only one function to use for these 2 cases.
  • rds_to_parquet()
  • fst_to_parquet()
  • table_to_parquet()
    • The other benefit of this function is that it handles SAS, SPSS and Stata files in a same function. There is only one function to use for these 3 cases. To avoid overcharging R's RAM for huge table, the conversion can be done by chunk. For more information, see here
  • sqlite_to_parquet()
  • dbi_to_parquet()

For more details, see the examples associated with each function in the documentation.

Example

You want to use the Insee file of first names by birth department? Use R and {parquetize} package that takes care of everything: it downloads the data (3.7 million rows) and converts it to parquet format in few seconds !

Contribution

Feel welcome to contribute to add features that you find useful in your daily work. Ideas are welcomed in the issues.

Metadata

Version

0.5.7

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows