Concatenate two PySpark dataframes

后端 未结 10 1370
独厮守ぢ
独厮守ぢ 2020-12-02 16:28

I\'m trying to concatenate two PySpark dataframes with some columns that are only on each of them:

from pyspark.sql.functions import randn, rand

df_1 = sqlC         


        
10条回答
  •  猫巷女王i
    2020-12-02 17:24

    df_concat = df_1.union(df_2)
    

    The dataframes may need to have identical columns, in which case you can use withColumn() to create normal_1 and normal_2

提交回复
热议问题