下面的union_all函数尝试这样做:from pyspark.sql import DataFrame
return reduce(DataFrame.union, dfs)TypeError: reduce() of empty sequencewith no initial value
从这一讨论中
代码在以下方面失败:Number of columns of the returned pandas.DataFrame doesn't match specified schema.熊猫功能from pandas import Timestamp
sdf = spark.createDataFrame(df)
sdf.print
为了检查等式,我使用了toDF(),它不幸地给出了一个模式,在模拟的dataframe中为"_id“提供了一个nullable = true,从而使测试失败(注意,函数的”实际“输出为nullable我还尝试过创建模拟的dataframe,这是一种导致错误的不同方式:import org.apache.spark.sql.Encoders
va