pyspark.sql.functions.version#

pyspark.sql.functions.version()[source]#

Returns the Spark version. The string contains 2 fields, the first being a release version and the second being a git revision.

New in version 3.5.0.

Examples

>>> df = spark.range(1)
>>> df.select(version()).show(truncate=False) 
+----------------------------------------------+
|version()                                     |
+----------------------------------------------+
|3.5.0 cafbea5b13623276517a9d716f75745eff91f616|
+----------------------------------------------+