diff options
author | Liwei Lin <lwlin7@gmail.com> | 2016-07-13 22:30:46 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-07-13 22:30:46 -0700 |
commit | 39c836e976fcae51568bed5ebab28e148383b5d4 (patch) | |
tree | 7d28d8d54607d4d10e466b2bffb44a6fa51846dd /python/pyspark | |
parent | 9c530576a44cbeb956db94e7fdd1fad50bd62973 (diff) | |
download | spark-39c836e976fcae51568bed5ebab28e148383b5d4.tar.gz spark-39c836e976fcae51568bed5ebab28e148383b5d4.tar.bz2 spark-39c836e976fcae51568bed5ebab28e148383b5d4.zip |
[SPARK-16503] SparkSession should provide Spark version
## What changes were proposed in this pull request?
This patch enables SparkSession to provide spark version.
## How was this patch tested?
Manual test:
```
scala> sc.version
res0: String = 2.1.0-SNAPSHOT
scala> spark.version
res1: String = 2.1.0-SNAPSHOT
```
```
>>> sc.version
u'2.1.0-SNAPSHOT'
>>> spark.version
u'2.1.0-SNAPSHOT'
```
Author: Liwei Lin <lwlin7@gmail.com>
Closes #14165 from lw-lin/add-version.
Diffstat (limited to 'python/pyspark')
-rw-r--r-- | python/pyspark/sql/session.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python/pyspark/sql/session.py b/python/pyspark/sql/session.py index a360fbefa4..594f9375f7 100644 --- a/python/pyspark/sql/session.py +++ b/python/pyspark/sql/session.py @@ -234,6 +234,12 @@ class SparkSession(object): @property @since(2.0) + def version(self): + """The version of Spark on which this application is running.""" + return self._jsparkSession.version() + + @property + @since(2.0) def conf(self): """Runtime configuration interface for Spark. |