我将数据加载到其中一列所在的数据帧中 zipCode (String type).
zipCode
(String type).
scala> val df = Seq("2", "1", null).toDF("x") df: org.apache.spark.sql.DataFrame = [x: string] scala> df.orderBy($"x".asc_nulls_last).show +----+ | x| +----+ | 1| | 2| |null| +----+