CertLumen

Databricks Data Engineer Professional · Section 5 · 15% of the exam

Choose the appropriate Delta optimization technique (deletion vectors, Liquid Clustering, CLUSTER BY AUTO) for a given table access pattern.

One of the objectives of the Databricks Certified Data Engineer Professional exam, in the section “Cost & Performance Optimization”. Here is what it covers, the points to remember and a question to try.

What it covers

Compare Hive-style partitioning, ZORDER, liquid clustering with explicit keys and CLUSTER BY AUTO for a given table size and query pattern, and decide when deletion vectors pay off for updates, deletes and concurrent writers.

Points to remember

  • Data skipping uses per-file min/max statistics; the layout decides how many files a filter can skip.
  • Partitioning: low-cardinality columns with at least 1 GB per partition; don't partition under 1 TB; use liquid clustering from 1 to 100 TB.
  • Z-order: OPTIMIZE ... ZORDER BY, within partitions, rewrites what it targets, weaker with each column, never run by predictive optimization.
  • Liquid clustering: up to 4 keys, incremental OPTIMIZE, keys changeable (OPTIMIZE FULL to recluster), incompatible with partitioning and ZORDER.
  • MERGE, UPDATE and DELETE don't cluster on write; OPTIMIZE or predictive optimization catches up.

Try a question

An engineer wants to create workspace.sales.orders_lc from workspace.sales.orders_raw in one statement, as a table liquid clustered by customer_id. Which statement does this?

  1. ACREATE TABLE workspace.sales.orders_lc AS SELECT * FROM workspace.sales.orders_raw CLUSTER BY customer_id
  2. BCREATE TABLE workspace.sales.orders_lc PARTITIONED BY (customer_id) CLUSTER BY (customer_id) AS SELECT * FROM workspace.sales.orders_raw
  3. CCREATE TABLE workspace.sales.orders_lc CLUSTER BY (customer_id) AS SELECT * FROM workspace.sales.orders_raw
  4. DCREATE TABLE workspace.sales.orders_lc AS SELECT * FROM workspace.sales.orders_raw ZORDER BY (customer_id)
Show the answer

C. In a CTAS statement, CLUSTER BY must come right after the table name, before AS SELECT. Placed at the end of the SELECT, CLUSTER BY is the query clause that distributes and sorts the result rows, so the new table gets no clustering keys.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Choosing a Layout: Liquid Clustering, Deletion Vectors, Partitioning and Z-order teaches this objective (about 55 minutes), and 17 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 45 objectives · Next objective →