Dave_Nithio
Contributor II

Also attempted to create a blank pyspark dataframe and write as a delta table:

df = spark.createDataFrame([], StructType([]))
df.write.format("delta").saveAsTable(table_name)

But this fails with:

Data used in creating the Delta table doesn't have any columns.

Another option could be to create a test column, alter the table, stream the data then remove the test column.