I am trying to create an empty dataframe in Spark (Pyspark).
I am using similar approach to the one discussed here enter link description here, but it is not working.
If you want an empty dataframe based on an existing one, simple limit rows to 0. In PySpark :
emptyDf = existingDf.limit(0)