Skip to content

Instantly share code, notes, and snippets.

@fyyying
Created July 24, 2020 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fyyying/11f189a21f947cca42a0b5c2a59d89b3 to your computer and use it in GitHub Desktop.
Save fyyying/11f189a21f947cca42a0b5c2a59d89b3 to your computer and use it in GitHub Desktop.
from pyspark.sql.types import StructType
# Create an empty DataFrame with empty schema
schema = StructType([])
spark.createDataFrame(spark.sparkContext.emptyRDD(), schema)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment