An existing production Delta table is configured with Hive-style date partitioning (PARTITIONED BY date) and a nightly Z-order job (OPTIMIZE ... ZORDER BY (region, category)). The data engineering team wants to migrate this table to liquid clustering for better performance and reduced maintenance overhead. Which of the following statements is TRUE about this migration, and what is the recommended approach?
Answer & explanation
Correct answer: C
WHY C: Liquid clustering is explicitly incompatible with both Hive-style partitioning and ZORDER. You cannot add liquid clustering to an existing partitioned table — the table must be recreated without partitioning. The correct migration path is CTAS (CREATE TABLE ... AS SELECT) without a PARTITION BY clause, specifying CLUSTER BY on the migration-recommended columns. For a table using partition key (date) + ZORDER keys (region, category), the documentation recommends using all as clustering keys: CLUSTER BY (date, region, category). After creating the table with liquid clustering, OPTIMIZE FULL (Databricks Runtime 16.0+) forces reclustering of all existing records. WHY NOT A: Liquid clustering is NOT compatible with partitioning — attempting to add CLUSTER BY to a partitioned table will fail. WHY NOT B: ALTER TABLE ... CLUSTER BY only works on existing UNPARTITIONED tables. It does not drop partitioning or rewrite historical data — and it would fail on a partitioned table. WHY NOT D: Using liquid clustering alongside partitioning simultaneously is not supported. Liquid clustering is designed to REPLACE both partitioning and Z-order, not supplement them. WHY NOT E: An ALTER TABLE REMOVE PARTITIONING command is not supported in Delta Lake. Option E's conclusion (CTAS is required) is correct, but the framing misidentifies the blocking issue. Delta liquid clustering cannot be added to a partitioned table — the incompatibility is by design, not merely due to a missing ALTER TABLE command.