Skip to content

Commit 65e5b26

Browse files
felixcheungFelix Cheung
authored andcommitted
[SPARK-26010][R] fix vignette eval with Java 11
## What changes were proposed in this pull request? changes in vignette only to disable eval ## How was this patch tested? Jenkins Author: Felix Cheung <[email protected]> Closes apache#23007 from felixcheung/rjavavervig. (cherry picked from commit 88c8262) Signed-off-by: Felix Cheung <[email protected]>
1 parent 3bc4c33 commit 65e5b26

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

R/pkg/vignettes/sparkr-vignettes.Rmd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ First, let's load and attach the package.
5757
library(SparkR)
5858
```
5959

60+
```{r, include=FALSE}
61+
# disable eval if java version not supported
62+
override_eval <- tryCatch(!is.numeric(SparkR:::checkJavaVersion()),
63+
error = function(e) { TRUE },
64+
warning = function(e) { TRUE })
65+
66+
if (override_eval) {
67+
opts_hooks$set(eval = function(options) {
68+
options$eval = FALSE
69+
options
70+
})
71+
}
72+
```
73+
6074
`SparkSession` is the entry point into SparkR which connects your R program to a Spark cluster. You can create a `SparkSession` using `sparkR.session` and pass in options such as the application name, any Spark packages depended on, etc.
6175

6276
We use default settings in which it runs in local mode. It auto downloads Spark package in the background if no previous installation is found. For more details about setup, see [Spark Session](#SetupSparkSession).

0 commit comments

Comments
 (0)