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

>>> from pyspark.sql import functions as sf
>>> spark.range(1).select(sf.version()).show(truncate=False) 
+----------------------------------------------+
|version()                                     |
+----------------------------------------------+
|4.0.0 4f8d1f575e99aeef8990c63a9614af0fc5479330|
+----------------------------------------------+