-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25821][SQL] Remove SQLContext methods deprecated in 1.4 #22815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
c42212e
55b7385
98ef77e
92dda99
8199362
10e403a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -343,7 +343,6 @@ setMethod("toDF", signature(x = "RDD"), | |
| #' path <- "path/to/file.json" | ||
| #' df <- read.json(path) | ||
| #' df <- read.json(path, multiLine = TRUE) | ||
| #' df <- jsonFile(path) | ||
| #' } | ||
| #' @name read.json | ||
| #' @method read.json default | ||
|
|
@@ -363,51 +362,6 @@ read.json <- function(x, ...) { | |
| dispatchFunc("read.json(path)", x, ...) | ||
| } | ||
|
|
||
| #' @rdname read.json | ||
| #' @name jsonFile | ||
| #' @method jsonFile default | ||
| #' @note jsonFile since 1.4.0 | ||
| jsonFile.default <- function(path) { | ||
| .Deprecated("read.json") | ||
| read.json(path) | ||
| } | ||
|
|
||
| jsonFile <- function(x, ...) { | ||
| dispatchFunc("jsonFile(path)", x, ...) | ||
| } | ||
|
|
||
| #' JSON RDD | ||
| #' | ||
| #' Loads an RDD storing one JSON object per string as a SparkDataFrame. | ||
| #' | ||
| #' @param sqlContext SQLContext to use | ||
| #' @param rdd An RDD of JSON string | ||
| #' @param schema A StructType object to use as schema | ||
| #' @param samplingRatio The ratio of simpling used to infer the schema | ||
| #' @return A SparkDataFrame | ||
| #' @noRd | ||
| #' @examples | ||
| #'\dontrun{ | ||
| #' sparkR.session() | ||
| #' rdd <- texFile(sc, "path/to/json") | ||
| #' df <- jsonRDD(sqlContext, rdd) | ||
| #'} | ||
|
|
||
| # TODO: remove - this method is no longer exported | ||
| # TODO: support schema | ||
| jsonRDD <- function(sqlContext, rdd, schema = NULL, samplingRatio = 1.0) { | ||
| .Deprecated("read.json") | ||
| rdd <- serializeToString(rdd) | ||
| if (is.null(schema)) { | ||
| read <- callJMethod(sqlContext, "read") | ||
| # samplingRatio is deprecated | ||
| sdf <- callJMethod(read, "json", callJMethod(getJRDD(rdd), "rdd")) | ||
| dataFrame(sdf) | ||
| } else { | ||
| stop("not implemented") | ||
| } | ||
| } | ||
|
|
||
| #' Create a SparkDataFrame from an ORC file. | ||
| #' | ||
| #' Loads an ORC file, returning the result as a SparkDataFrame. | ||
|
|
@@ -434,6 +388,7 @@ read.orc <- function(path, ...) { | |
| #' Loads a Parquet file, returning the result as a SparkDataFrame. | ||
| #' | ||
| #' @param path path of file to read. A vector of multiple paths is allowed. | ||
| #' @param ... additional external data source specific named properties. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @felixcheung I got this CRAN doc error on the last run: I guess this is what it wants, but not sure why it didn't come up before?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sean actually I opened a PR yesterday against your branch .. srowen#2
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, I missed that, sorry. I'll incorporate both changes. |
||
| #' @return SparkDataFrame | ||
| #' @rdname read.parquet | ||
| #' @name read.parquet | ||
|
|
@@ -454,20 +409,6 @@ read.parquet <- function(x, ...) { | |
| dispatchFunc("read.parquet(...)", x, ...) | ||
| } | ||
|
|
||
| #' @param ... argument(s) passed to the method. | ||
| #' @rdname read.parquet | ||
| #' @name parquetFile | ||
| #' @method parquetFile default | ||
| #' @note parquetFile since 1.4.0 | ||
| parquetFile.default <- function(...) { | ||
| .Deprecated("read.parquet") | ||
| read.parquet(unlist(list(...))) | ||
| } | ||
|
|
||
| parquetFile <- function(x, ...) { | ||
| dispatchFunc("parquetFile(...)", x, ...) | ||
| } | ||
|
|
||
| #' Create a SparkDataFrame from a text file. | ||
| #' | ||
| #' Loads text files and returns a SparkDataFrame whose schema starts with | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixcheung maybe you can check my work here. Is this the right amount of stuff to delete from SparkR when removing these deprecated SQLContext methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's part of it, I want to remove other deprecated methods also