メインコンテンツまでスキップ

asc_nulls_first (列)

列を昇順に並べ替え、null値が最初に表示されるようにします。

構文

Python
asc_nulls_first()

戻り値

Python
from pyspark.sql import Row
df = spark.createDataFrame(
[('Tom', 80), (None, 60), ('Alice', None)], ["name", "height"])
df.select(df.name).orderBy(df.name.asc_nulls_first()).collect()
Output
# [Row(name=None), Row(name='Alice'), Row(name='Tom')]
このページの見出し