spark.sql(query).show() 显示SQL表格 query = """ SELECT ROW_NUMBER() OVER (ORDER BY time) AS row, train_id, station, time, LEAD(time,1) OVER (ORDER BY time) AS time_next FROM schedule """ spark.sql(query).show() aggregation聚合 获取单组聚合值,一二两行输出一样的结果: # Give the identical re...