I have a dataframe in Pyspark(2.3) from which i need to generate a partitioned create table statement to run through spark.sql() to make it hive compatible .
Sample Dataframe:
final.printSchema()
root
|-- name: string (nullable = true)
|-- age: string (nullable = true)
|-- value: long (nullable = true)
|-- date: string (nullable = true)
|-- subid: string( nullable=true)
The script should read the dataframe and create the below table and consider the last two columns as the partitioned columns.
`create table schema.final( name string ,age string ,value long )
partitioned by (date string , subid string) stored as parquet;`
Any help with the above pyspark solution will be really great