In PySpark it you can define a schema and read data sources with this pre-defined schema, e. g.:
Schema = StructType([ Str
Yes it is possible. Use DataFrame.schema property
schema
Returns the schema of this DataFrame as a pyspark.sql.types.StructType.
>>> df.schema StructType(List(StructField(age,IntegerType,true),StructField(name,StringType,true)))
New in version 1.3.
Schema can be also exported to JSON and imported back if needed.