Created
February 21, 2019 17:28
-
-
Save bepcyc/22f5fbd2192a888fd5669bb4006fbd44 to your computer and use it in GitHub Desktop.
Generate Avro Schema out of Apache Spark DataFrame
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.spark.sql.avro.SchemaConverters | |
| SchemaConverters.toAvroType(df.schema) // add .toString if you need JSON here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment