pyspark.sql.functions.upper#

pyspark.sql.functions.upper(col)[source]#

Converts a string expression to upper case.

New in version 1.5.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

target column to work on.

Returns
Column

upper case values.

Examples

>>> df = spark.createDataFrame(["Spark", "PySpark", "Pandas API"], "STRING")
>>> df.select(upper("value")).show()
+------------+
|upper(value)|
+------------+
|       SPARK|
|     PYSPARK|
|  PANDAS API|
+------------+