I have a schema:
schema = StructType(
[
StructField("COUNTRY", StringType(), False),
StructField("ID", StringType(), False),
StructField("DATE", DateType(), False),
... x80
]
and I'd like to create a DF with only 30 of fields from such schema. How to do it in an efficient way?
What I do, but it seems not eficient - I'm looking for more effective way. Is there such?
created_df_with_only_few_fields_from_the_schema = self.create_df(
[
{
"COUNTRY": "Germany",
... x30
},schema["ID","DATE",... x30] --> all the fields that I'd like to extract
]