In many data lakes I see that data is partitioned by year, then month, then day, for example:
year=2019 / month=05 / day=15
What is the advantage of doing this vs. simply partitioning by date? e.g.:
date=20190515
The only advantage I can think of is if, for example, analysts want to query all data for a particular month/year. If just partitioning on date, then they would have to write a query with a calculation on the partition key, such as below psuedocode:
SELECT * FROM myTable WHERE LEFT(date,4) = 2019
Would spark still be able to do partition pruning for queries like the above? Are there any other advantages I haven't considered to the more nested partition structure?
Thank you