Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 10:41 AM
After you read csv to dataframe spark.read.csv ... there are 3 ways
DataFrame.Schema
DataFrame.printSchema() - it is StructType
and 3rd tricky way is DDL string
DataFrame._jdf.schema().toDDL()
Usually DDL as it is simple string is easiest to save somewhere and than reuse. Just insert to some delta table schema and then select when needed.
My blog: https://databrickster.medium.com/