thisisnic commented on code in PR #12826:
URL: https://github.com/apache/arrow/pull/12826#discussion_r924478039
##########
r/R/dataset.R:
##########
@@ -438,3 +438,20 @@ stop_if_no_datasets <- function() {
stop("This build of the arrow package does not support Datasets", call. =
FALSE)
}
}
+
+#' Add filename as dataset column
+#'
+#' @examplesIf requireNamespace("dplyr", quietly = TRUE)
+#' library(dplyr)
+#' tf <- tempfile()
+#' dir.create(tf)
+#' write_dataset(mtcars, tf, partitioning = "cyl")
+#'
+#' open_dataset(tf) %>%
+#' mutate(filename = add_filename()) %>%
+#' collect()
+#'
+#' @export
+add_filename <- function() {
Review Comment:
I'll pop it in there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]