收集整个 DataFrame 到本地列表: frompyspark.sqlimportSparkSession# 创建 SparkSessionspark = SparkSession.builder.appName("collect-example").getOrCreate()# 创建一个示例 DataFramedata = [(1,"Alice"), (2,"Bob"), (3,"Charlie")] df = spark.createDataFrame(data, ["id","name"])# 使用 coll...