Designing and applying a partitioning scheme
Partitioning in Azure Databricks (via Delta Lake) organizes data into subdirectories based on column values, enabling partition pruning so queries scan only relevant files instead of the full table. Choosing the right partitioning strategy balances query performance against the risk of creating too many small files, which can degrade performance and increase metadata overhead.
1 · Learn the must-know
- Use partitionBy() when writing a DataFrame or CREATE TABLE ... PARTITIONED BY in SQL to physically separate data into folders by the chosen column(s).
- Partition columns should have low-to-moderate cardinality (e.g., date, region, category); high-cardinality columns (like a unique ID or timestamp with seconds) create too many small partitions and hurt performance.
- As a general guideline, avoid partitioning tables smaller than about 1TB, and ensure each partition holds at least ~1GB of data to prevent the small-file problem.
- Partition pruning lets Spark skip reading irrelevant partitions when a query filters on the partition column, significantly reducing I/O.
- For high-cardinality columns or multi-dimensional filtering needs, Z-Ordering (via OPTIMIZE ... ZORDER BY) or Delta Lake Liquid Clustering are preferred over traditional partitioning since they co-locate related data without creating excessive directories.
- Regularly run OPTIMIZE to compact small files within partitions, and consider VACUUM to clean up obsolete files, since heavy partitioning combined with frequent small writes accelerates file fragmentation.
2 · Check your understanding
A data engineer is designing a partitioning scheme for a Delta Lake table that stores billions of retail transactions. Most analytical queries filter on a date range spanning several months, and the table already has an order_timestamp column that records the exact second an order was placed. Which approach should the engineer take when choosing a partition column?
What you have tried across DP-750's objectives, not a readiness score.
Set up and configure an Azure Databricks environment15-20% of the exam0 of 13 tried
Secure and govern Unity Catalog objects15-20% of the exam0 of 12 tried
Prepare and process data30-35% of the exam0 of 28 tried
Deploy and maintain data pipelines and workloads30-35% of the exam0 of 24 tried
3 · Keep going
Ready for more? Take a weighted mock or try free practice questions.