Pular para o conteúdo principal

desc (Coluna)

Ordene a coluna em ordem decrescente.

Sintaxe

Python
desc()

Devoluções

Coluna

Exemplos

Python
from pyspark.sql import Row
df = spark.createDataFrame([('Tom', 80), ('Alice', None)], ["name", "height"])
df.select(df.name).orderBy(df.name.desc()).collect()
Output
# [Row(name='Tom'), Row(name='Alice')]