Have one function to create files with partitions, in that the partitions are created based on metadata (getPartitionColumns) that we are keeping. In a table we have two columns that are mentioned as partition columns, say 'Team' and 'Speciality'.
While executing, partition columns are not substituted properly within the datafrme's write method and getting an error like below
AnalysisException: Partition column `"Team","Speciality"` not found in schema
But these columns are already there in the data frame. Any idea how to resolve this?
Seems like the value `"Team","Speciality" is considered as single column instead of separate columns.
def dfWrite(df, targetPath,tableName):
partitionColumn = getPartitionColumns(tableName)
# "Team", "Speciality"
df.write.option("header", True) \
.partitionBy(partitionColumn) \
.mode("overwrite") \
.csv(targetPath)