File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,21 @@ if [[ $NUM_APPLICATION_OPTS -gt 0 && "${APPLICATION_OPTS[0]}" =~ \.R$ ]]; then
54
54
exec " $SPARK_HOME " /bin/spark-submit --class edu.berkeley.cs.amplab.sparkr.SparkRRunner --files " $primary " " ${SUBMISSION_OPTS[@]} " " $SPARKR_JAR_FILE " " $primary " " ${APPLICATION_OPTS[@]: 1} "
55
55
else
56
56
57
+ export R_PROFILE_USER=" /tmp/sparkR.profile"
58
+
57
59
# If we don't have an R file to run, run R shell
60
+ cat > /tmp/sparkR.profile << EOF
61
+ .First <- function() {
62
+ projecHome <- Sys.getenv("PROJECT_HOME")
63
+ Sys.setenv(NOAWT=1)
64
+ .libPaths(c(paste(projecHome,"/..", sep=""), .libPaths()))
65
+ require(SparkR)
66
+ sc <- sparkR.init()
67
+ assign("sc", sc, envir=.GlobalEnv)
68
+ cat("\n Welcome to SparkR!")
69
+ cat("\n Spark context is available as sc\n")
70
+ }
71
+ EOF
58
72
R
59
73
60
74
fi
You can’t perform that action at this time.
0 commit comments