Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Sort the column in descending order with null values appearing first.
Syntax
desc_nulls_first()
Returns
Column
Examples
from pyspark.sql import Row
df = spark.createDataFrame(
[('Tom', 80), (None, 60), ('Alice', None)], ["name", "height"])
df.select(df.name).orderBy(df.name.desc_nulls_first()).collect()
# [Row(name=None), Row(name='Tom'), Row(name='Alice')]