Skip to content
Permalink
Browse files

[SPARK-23780][R] Failed to use googleVis library with new SparkR

## What changes were proposed in this pull request?

change generic to get it to work with googleVis
also fix lintr

## How was this patch tested?

manual test, unit tests

Author: Felix Cheung <felixcheung_m@hotmail.com>

Closes #21315 from felixcheung/googvis.

(cherry picked from commit 9059f1e)
Signed-off-by: Felix Cheung <felixcheung@apache.org>
  • Loading branch information...
felixcheung authored and Felix Cheung committed May 15, 2018
1 parent eb7b373 commit a886dc23aeae8a79f7bc4d1aeb47d545e5550604
Showing with 5 additions and 4 deletions.
  1. +3 −2 R/pkg/R/client.R
  2. +1 −1 R/pkg/R/generics.R
  3. +1 −1 R/pkg/R/sparkR.R
@@ -63,7 +63,7 @@ generateSparkSubmitArgs <- function(args, sparkHome, jars, sparkSubmitOpts, pack
checkJavaVersion <- function() {
javaBin <- "java"
javaHome <- Sys.getenv("JAVA_HOME")
javaReqs <- utils::packageDescription(utils::packageName(), fields=c("SystemRequirements"))
javaReqs <- utils::packageDescription(utils::packageName(), fields = c("SystemRequirements"))
sparkJavaVersion <- as.numeric(tail(strsplit(javaReqs, "[(=)]")[[1]], n = 1L))
if (javaHome != "") {
javaBin <- file.path(javaHome, "bin", javaBin)
@@ -90,7 +90,8 @@ checkJavaVersion <- function() {
# Extract 8 from it to compare to sparkJavaVersion
javaVersionNum <- as.integer(strsplit(javaVersionStr, "[.]")[[1L]][2])
if (javaVersionNum != sparkJavaVersion) {
stop(paste("Java version", sparkJavaVersion, "is required for this package; found version:", javaVersionStr))
stop(paste("Java version", sparkJavaVersion, "is required for this package; found version:",
javaVersionStr))
}
}

@@ -762,7 +762,7 @@ setGeneric("summarize", function(x, ...) { standardGeneric("summarize") })
#' @export
setGeneric("summary", function(object, ...) { standardGeneric("summary") })

setGeneric("toJSON", function(x) { standardGeneric("toJSON") })
setGeneric("toJSON", function(x, ...) { standardGeneric("toJSON") })

setGeneric("toRDD", function(x) { standardGeneric("toRDD") })

@@ -197,7 +197,7 @@ sparkR.sparkContext <- function(

# Don't use readString() so that we can provide a useful
# error message if the R and Java versions are mismatched.
authSecretLen = readInt(f)
authSecretLen <- readInt(f)
if (length(authSecretLen) == 0 || authSecretLen == 0) {
stop("Unexpected EOF in JVM connection data. Mismatched versions?")
}

0 comments on commit a886dc2

Please sign in to comment.
You can’t perform that action at this time.