I am using Spark SQL with dataframes. I have an input dataframe, and I would like to append (or insert) its rows to a larger dataframe that has more columns. How would I do
Spark DataFrames are immutable so it is not possible to append / insert rows. Instead you can just add missing columns and use UNION ALL:
DataFrames
UNION ALL
output.unionAll(input.select($"*", lit(""), current_timestamp.cast("long")))