Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/15239#discussion_r80855269 --- Diff: R/pkg/R/DataFrame.R --- @@ -55,6 +55,19 @@ setMethod("initialize", "SparkDataFrame", function(.Object, sdf, isCached) { .Object }) +#' Set options/mode and then return the write object +#' @noRd +setWriteOptions <- function(write, path = NULL, mode = 'error', ...) { + options <- varargsToStrEnv(...) + if (!is.null(path)) { + options[["path"]] <- path + } + jmode <- convertToJSaveMode(mode) + write <- callJMethod(write, "mode", jmode) + write <- callJMethod(write, "options", options) + write --- End diff -- Yes, I think that sounds good. Actually, I was thinking single common method for options in both `read`/`write` (maybe in `utils.R`?) and two common method for reading/writing in `read`/`write`. I am wondering maybe if you think it is okay for me to try this in another PR after this one/https://github.com/apache/spark/pull/15231
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org