pyspark.sql.functions.collation#

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

Returns the collation name of a given column.

New in version 4.0.0.

Parameters
colColumn or str

Target string column to work on.

Returns
Column

collation name of a given expression.

Examples

>>> df = spark.createDataFrame([('name',)], ['dt'])
>>> df.select(collation('dt').alias('collation')).show(truncate=False)
+--------------------------+
|collation                 |
+--------------------------+
|SYSTEM.BUILTIN.UTF8_BINARY|
+--------------------------+