I have to write a Spark dataframe in the path of the format: base_path/{year}/{month}/{day}/{hour}/
If I do something like below:
pc = ["year", "month", "day", "hour"]
df.write.partitionBy(*pc).parquet("base_path/", mode = 'append')
It creates the location as: base_path/year=2022/month=04/day=25/hour=10/
.
I do not want the column names like year, month, day and hour to be the part of path but something like: base_path/2022/04/25/10/
. Any solution for this?