Skip to content

Commit f2fb028

Browse files
Alok  Singhshivaram
authored andcommitted
[SPARK-8111] [SPARKR] SparkR shell should display Spark logo and version banner on startup.
spark version is taken from the environment variable SPARK_VERSION Author: Alok Singh <[email protected]> Author: Alok Singh <[email protected]> Closes apache#6944 from aloknsingh/aloknsingh_spark_jiras and squashes the following commits: ed607bd [Alok Singh] [SPARK-8111][SparkR] As per suggestion, 1) using the version from sparkContext rather than the Sys.env. 2) change "Welcome to SparkR!" to "Welcome to" followed by Spark logo and version acd5b85 [Alok Singh] fix the jira SPARK-8111 to add the spark version and logo. Currently spark version is taken from the environment variable SPARK_VERSION
1 parent f2022fa commit f2fb028

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

R/pkg/inst/profile/shell.R

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,21 @@
2727
sc <- SparkR::sparkR.init()
2828
assign("sc", sc, envir=.GlobalEnv)
2929
sqlContext <- SparkR::sparkRSQL.init(sc)
30+
sparkVer <- SparkR:::callJMethod(sc, "version")
3031
assign("sqlContext", sqlContext, envir=.GlobalEnv)
31-
cat("\n Welcome to SparkR!")
32+
cat("\n Welcome to")
33+
cat("\n")
34+
cat(" ____ __", "\n")
35+
cat(" / __/__ ___ _____/ /__", "\n")
36+
cat(" _\\ \\/ _ \\/ _ `/ __/ '_/", "\n")
37+
cat(" /___/ .__/\\_,_/_/ /_/\\_\\")
38+
if (nchar(sparkVer) == 0) {
39+
cat("\n")
40+
} else {
41+
cat(" version ", sparkVer, "\n")
42+
}
43+
cat(" /_/", "\n")
44+
cat("\n")
45+
3246
cat("\n Spark context is available as sc, SQL context is available as sqlContext\n")
3347
}

0 commit comments

Comments
 (0)