felixcheung commented on a change in pull request #24414: [SPARK-22044][SQL]
Add `cost` and `codegen` arguments to `explain`
URL: https://github.com/apache/spark/pull/24414#discussion_r277120816
##########
File path: R/pkg/R/DataFrame.R
##########
@@ -147,19 +155,16 @@ setMethod("schema",
#' sparkR.session()
#' path <- "path/to/file.json"
#' df <- read.json(path)
-#' explain(df, TRUE)
+#' explain(df)
+#' explain(df, extended = TRUE)
+#' explain(df, codegen = TRUE)
+#' explain(df, cost = TRUE)
#'}
#' @note explain since 1.4.0
setMethod("explain",
signature(x = "SparkDataFrame"),
- function(x, extended = FALSE) {
- queryExec <- callJMethod(x@sdf, "queryExecution")
- if (extended) {
- cat(callJMethod(queryExec, "toString"))
- } else {
- execPlan <- callJMethod(queryExec, "executedPlan")
- cat(callJMethod(execPlan, "toString"))
- }
+ function(x, extended = FALSE, codegen = FALSE, cost = FALSE) {
Review comment:
does this change the result (by default when `extended = FALSE, codegen =
FALSE, cost = FALSE`) from before?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]