nealrichardson commented on a change in pull request #9591: URL: https://github.com/apache/arrow/pull/9591#discussion_r585104212
########## File path: r/R/dataset-write.R ########## @@ -71,25 +72,30 @@ #' d <- dplyr::group_by(mtcars, cyl, gear) #' #' d %>% -#' write_dataset(two_part_dir_2, "parquet") +#' write_dataset(two_part_dir_2) #' #' # Just passing an additional hive_style option to see the difference #' # in the output #' #' d %>% -#' write_dataset(two_part_dir_2, "parquet", hive_style = FALSE) +#' write_dataset(two_part_dir_2, hive_style = FALSE) #' #' list.files(two_part_dir_2, pattern = "parquet", recursive = TRUE) #' list.files(two_part_dir_3, pattern = "parquet", recursive = TRUE) #' } #' @export write_dataset <- function(dataset, path, - format = dataset$format, + format = "parquet", Review comment: I don't think this is the right change. Please see the proposal in https://issues.apache.org/jira/browse/ARROW-11582?focusedCommentId=17292994&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17292994. I'd recommend reverting this change and doing the format argument change in a separate PR associated with that JIRA issue, rather than grow the scope of this one. ########## File path: r/R/dataset-write.R ########## @@ -71,25 +72,30 @@ #' d <- dplyr::group_by(mtcars, cyl, gear) #' #' d %>% -#' write_dataset(two_part_dir_2, "parquet") +#' write_dataset(two_part_dir_2) #' #' # Just passing an additional hive_style option to see the difference #' # in the output #' #' d %>% -#' write_dataset(two_part_dir_2, "parquet", hive_style = FALSE) +#' write_dataset(two_part_dir_2, hive_style = FALSE) #' #' list.files(two_part_dir_2, pattern = "parquet", recursive = TRUE) #' list.files(two_part_dir_3, pattern = "parquet", recursive = TRUE) #' } #' @export write_dataset <- function(dataset, path, - format = dataset$format, + format = "parquet", partitioning = dplyr::group_vars(dataset), basename_template = paste0("part-{i}.", as.character(format)), hive_style = TRUE, ...) { + if (inherits(dataset$format, "ParquetFileFormat")) { + format <- dataset$format + basename_template <- paste0("part-{i}.", as.character(format)) + } + Review comment: I don't think this helps anything. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org