Skip to content

Commit

Permalink
docs: add a example of reading hive-style partitioned parquet dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi committed Oct 31, 2023
1 parent 865387c commit dbe42ad
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
18 changes: 16 additions & 2 deletions R/parquet.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,22 @@
#' @return LazyFrame
#' @name scan_parquet
#' @rdname IO_scan_parquet
#' @examples
#' # TODO write parquet example
#' @examplesIf requireNamespace("arrow", quietly = TRUE) & arrow::arrow_with_dataset() & arrow::arrow_with_parquet()
#' temp_dir = tempfile()
#' # Write a hive-style partitioned parquet dataset
#' arrow::write_dataset(
#' mtcars,
#' temp_dir,
#' partitioning = c("cyl", "gear"),
#' format = "parquet",
#' hive_style = TRUE
#' )
#' list.files(temp_dir, recursive = TRUE)
#'
#' # Read the dataset
#' pl$scan_parquet(
#' file.path(temp_dir, "**/*.parquet")
#' )$collect()
pl$scan_parquet = function(
file, # : str | Path,
n_rows = NULL, # : int | None = None,
Expand Down
18 changes: 17 additions & 1 deletion man/IO_scan_parquet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dbe42ad

Please sign in to comment.