Repository: spark
Updated Branches:
  refs/heads/master db8784fea -> 7bf8a4049

[SPARK-17686][CORE] Support printing out scala and java version with 
spark-submit --version command

## What changes were proposed in this pull request?

In our universal gateway service we need to specify different jars to Spark 
according to scala version. For now only after launching Spark application can 
we know which version of Scala it depends on. It makes hard for us to support 
different Scala + Spark versions to pick the right jars.

So here propose to print out Scala version according to Spark version in 
"spark-submit --version", so that user could leverage this output to make the 
choice without needing to launching application.

## How was this patch tested?

Manually verified in local environment.

Author: jerryshao <>

Closes #15456 from jerryshao/SPARK-17686.


Branch: refs/heads/master
Commit: 7bf8a4049866b2ec7fdf0406b1ad0c3a12488645
Parents: db8784f
Author: jerryshao <>
Authored: Thu Oct 13 03:29:14 2016 -0400
Committer: Andrew Or <>
Committed: Thu Oct 13 03:29:14 2016 -0400

 core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala 
index 8061165..5c05228 100644
--- a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
@@ -24,6 +24,7 @@ import
 import scala.annotation.tailrec
 import scala.collection.mutable.{ArrayBuffer, HashMap, Map}
+import scala.util.Properties
 import org.apache.commons.lang3.StringUtils
 import org.apache.hadoop.fs.Path
@@ -47,7 +48,6 @@ import
 import org.apache.spark.launcher.SparkLauncher
 import org.apache.spark.util.{ChildFirstURLClassLoader, MutableURLClassLoader, 
  * Whether to submit, kill, or request the status of an application.
  * The latter two operations are currently supported only for standalone and 
Mesos cluster modes.
@@ -104,6 +104,8 @@ object SparkSubmit {
    /___/ .__/\_,_/_/ /_/\_\   version %s
+    printStream.println("Using Scala %s, %s, %s".format(
+      Properties.versionString, Properties.javaVmName, Properties.javaVersion))
     printStream.println("Branch %s".format(SPARK_BRANCH))
     printStream.println("Compiled by user %s on %s".format(SPARK_BUILD_USER, 
     printStream.println("Revision %s".format(SPARK_REVISION))

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to