df: DataFrame = spark.read.load('LOCATION') schema_json = df.schema.json() ddl = spark.sparkContext._jvm.org.apache.spark.sql.types.DataType.fromJson(schema_json).toDDL()