Skip to content

Commit acd5b85

Browse files
committed
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 9814b97 commit acd5b85

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

R/pkg/inst/profile/shell.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
.First <- function() {
1919
home <- Sys.getenv("SPARK_HOME")
20+
sparkVer <- Sys.getenv("SPARK_VERSION")
2021
.libPaths(c(file.path(home, "R", "lib"), .libPaths()))
2122
Sys.setenv(NOAWT=1)
2223

@@ -29,5 +30,18 @@
2930
sqlContext <- SparkR::sparkRSQL.init(sc)
3031
assign("sqlContext", sqlContext, envir=.GlobalEnv)
3132
cat("\n Welcome to SparkR!")
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)