Skip to content

Data Engineer Professional · Domain 5: Cost & Performance Optimization · 15% of the exam

Task 5.6: Compare Liquid Clustering vs partitioning/ZORDER for a given table size and query pattern.

Table size thresholds for partitioning, key cardinality, changing keys, concurrent writes, and migrating partitioned or Z-ordered tables.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the Databricks documentation page that proves it.

Question 1 · choose 1

A 2 TB Delta table is partitioned by region only so that five regional jobs can MERGE into it at the same time without write conflicts. The partitions have become full of small files, and most queries filter on order_date. The team wants fewer small files and good skipping on order_date without losing concurrent writes. What should they do?

  1. AKeep the region partitions and add order_date as a second partition column
  2. BKeep the region partitions and run OPTIMIZE ZORDER BY (order_date) nightly
  3. CSwitch to liquid clustering on order_date and rely on row-level concurrency
  4. DRun the five jobs one after another instead of at the same time
Show the answer and why
  • AKeep the region partitions and add order_date as a second partition column

    Incorrect

    Even more partitions make the small-file problem worse on a table of this size.

  • BKeep the region partitions and run OPTIMIZE ZORDER BY (order_date) nightly

    Incorrect

    This adds maintenance and keeps the over-partitioned layout that Databricks advises against for tables of this size.

  • CSwitch to liquid clustering on order_date and rely on row-level concurrency

    Correct

    Liquid clustering tables allow row-level concurrency, which reduces write conflicts without partition boundaries, and Databricks recommends it over partitioning for a table of this size.

  • DRun the five jobs one after another instead of at the same time

    Incorrect

    That removes conflicts by giving up the concurrent writes the team needs.

For a table of this size, Databricks recommends liquid clustering instead of partitioning. Liquid clustering tables support row-level concurrency, so concurrent writers conflict less without relying on partition boundaries.

Question 2 · choose 2

Queries on a large table filter on device.region, a field inside the STRUCT column device. The team compares partitioning with liquid clustering for skipping on this field. Which TWO statements are correct? (Choose TWO.)

  1. ALiquid clustering can use device.region as a clustering key
  2. BPartitioning by device.region works if the table is over 100 TB
  3. CPARTITIONED BY cannot use device.region as a partition column
  4. DLiquid clustering needs device to be cast to VARIANT first
  5. EZ-ordering by device.region can be combined with liquid clustering
Show the answer and why
  • ALiquid clustering can use device.region as a clustering key

    Correct

    Liquid clustering recognizes a struct field as a clustering key and is the only way to skip on it without extracting it.

  • BPartitioning by device.region works if the table is over 100 TB

    Incorrect

    Table size does not change the rule that partition columns must be top-level.

  • CPARTITIONED BY cannot use device.region as a partition column

    Correct

    Partition columns must be top-level; a struct field in PARTITIONED BY is treated as an expression.

  • DLiquid clustering needs device to be cast to VARIANT first

    Incorrect

    VARIANT is not a supported clustering type; the struct field is used directly.

  • EZ-ordering by device.region can be combined with liquid clustering

    Incorrect

    Liquid clustering is not compatible with ZORDER.

Partition columns must be top-level columns of supported types, so complex types and struct fields cannot be partition columns. Liquid clustering accepts a struct field as a key, which lets queries skip data on it.

Question 3 · choose 1

A new 400 GB Delta table will be filtered mostly by order_date. A teammate wants to partition it by order_date. What does Databricks recommend?

  1. APartition it by order_date and by customer_id for finer pruning
  2. BPartition it by order_date, because dates always benefit pruning
  3. CPartition it by hour to make partitions smaller
  4. DDo not partition it; tables under 1 TB should not be partitioned
Show the answer and why
  • APartition it by order_date and by customer_id for finer pruning

    Incorrect

    More partition columns make small partitions worse.

  • BPartition it by order_date, because dates always benefit pruning

    Incorrect

    At this size partitioning is likely to hurt performance.

  • CPartition it by hour to make partitions smaller

    Incorrect

    Smaller partitions perform worse than fewer, larger ones.

  • DDo not partition it; tables under 1 TB should not be partitioned

    Correct

    Databricks says not to partition tables with less than 1 TB of data.

Databricks does not recommend partitioning tables under 1 TB. Liquid clustering is recommended for new tables.

Question 4 · choose 1

A team does partition a very large table. What minimum amount of data per partition does Databricks recommend?

  1. AAt most 100 MB per partition
  2. BAt least 1 GB per partition
  3. CExactly one data file per partition
  4. DAt least 1 TB per partition
Show the answer and why
  • AAt most 100 MB per partition

    Incorrect

    Small partitions tend to perform worse.

  • BAt least 1 GB per partition

    Correct

    Each partition should contain at least 1 GB of data.

  • CExactly one data file per partition

    Incorrect

    File count is not the rule; partition size is.

  • DAt least 1 TB per partition

    Incorrect

    That is far more than the recommended minimum per partition.

Partitions should contain at least 1 GB of data; tables with fewer, larger partitions tend to outperform tables with many small ones.

Question 5 · choose 1

An unpartitioned table receives appends in time order and is often filtered on recent dates. Why does it prune reasonably well without any partitioning?

  1. ADelta creates hidden date partitions for every new table it writes
  2. BThe disk cache keeps the most recent data files in memory
  3. CUnpartitioned tables are clustered by ingestion time automatically
  4. DZ-order is applied automatically on the date column on every write
Show the answer and why
  • ADelta creates hidden date partitions for every new table it writes

    Incorrect

    No hidden partitions are created.

  • BThe disk cache keeps the most recent data files in memory

    Incorrect

    Caching speeds reads; it does not prune files.

  • CUnpartitioned tables are clustered by ingestion time automatically

    Correct

    Ingestion time clustering gives partitioning-like performance on unpartitioned tables.

  • DZ-order is applied automatically on the date column on every write

    Incorrect

    Z-order is not applied automatically.

Unpartitioned Delta Lake tables automatically use ingestion time clustering, which gives partitioning-like query performance when data arrives in time order.

Question 6 · choose 1

A data engineer creates a Unity Catalog managed Iceberg table with PARTITIONED BY (region). How does Unity Catalog treat this clause?

  1. AIt uses region as a liquid clustering key
  2. BIt creates Hive-style region partitions
  3. CIt rejects the statement
  4. DIt ignores the clause and leaves the table unclustered
Show the answer and why
  • AIt uses region as a liquid clustering key

    Correct

    For managed Iceberg tables, Unity Catalog supports only liquid clustering and interprets PARTITION BY columns as clustering keys.

  • BIt creates Hive-style region partitions

    Incorrect

    Managed Iceberg tables do not use partitioning.

  • CIt rejects the statement

    Incorrect

    The clause is accepted and mapped to clustering keys.

  • DIt ignores the clause and leaves the table unclustered

    Incorrect

    The columns become clustering keys.

Databricks recommends liquid clustering for managed tables. For managed Iceberg tables, Unity Catalog supports only liquid clustering and treats PARTITION BY columns as clustering keys.

Practice domain 5 →Practice all domains →