I have a dataframe with following schema:
root
|-- Id: integer (nullable = true)
|-- Id_FK: integer (nullable = true)
|-- Foo: integer (nullable = true)
|-- Bar: string (nullable = true)
|-- XPTO: string (nullable = true)
From that dataframe I want to create a JSON file with the column name and type as follow
{
"Id": "integer",
"Id_FK": "integer",
"Foo": "integer ",
"Bar": "string",
"XPTO": "string",
}
I'm trying to do that using pyspark, but I can't find any way to accomplish that. Can anyone help me?