diff options
author | Alok Singh <singhal@Aloks-MacBook-Pro.local> | 2015-06-23 12:47:55 -0700 |
---|---|---|
committer | Shivaram Venkataraman <shivaram@cs.berkeley.edu> | 2015-06-23 12:47:55 -0700 |
commit | f2fb0285ab6d4225c5350f109dea6c1c017bb491 (patch) | |
tree | 7823ce59c57e9c08276c483157039849e6d81a99 /R/pkg/inst/profile | |
parent | f2022fa0d375c804eca7803e172543b23ecbb9b7 (diff) | |
download | spark-f2fb0285ab6d4225c5350f109dea6c1c017bb491.tar.gz spark-f2fb0285ab6d4225c5350f109dea6c1c017bb491.tar.bz2 spark-f2fb0285ab6d4225c5350f109dea6c1c017bb491.zip |
[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 <singhal@Aloks-MacBook-Pro.local>
Author: Alok Singh <singhal@aloks-mbp.usca.ibm.com>
Closes #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
Diffstat (limited to 'R/pkg/inst/profile')
-rw-r--r-- | R/pkg/inst/profile/shell.R | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/R/pkg/inst/profile/shell.R b/R/pkg/inst/profile/shell.R index 773b6ecf58..7189f1a260 100644 --- a/R/pkg/inst/profile/shell.R +++ b/R/pkg/inst/profile/shell.R @@ -27,7 +27,21 @@ sc <- SparkR::sparkR.init() assign("sc", sc, envir=.GlobalEnv) sqlContext <- SparkR::sparkRSQL.init(sc) + sparkVer <- SparkR:::callJMethod(sc, "version") assign("sqlContext", sqlContext, envir=.GlobalEnv) - cat("\n Welcome to SparkR!") + cat("\n Welcome to") + cat("\n") + cat(" ____ __", "\n") + cat(" / __/__ ___ _____/ /__", "\n") + cat(" _\\ \\/ _ \\/ _ `/ __/ '_/", "\n") + cat(" /___/ .__/\\_,_/_/ /_/\\_\\") + if (nchar(sparkVer) == 0) { + cat("\n") + } else { + cat(" version ", sparkVer, "\n") + } + cat(" /_/", "\n") + cat("\n") + cat("\n Spark context is available as sc, SQL context is available as sqlContext\n") } |