Luu
Databricks Partner

Thank you for the quick reply Kaniz. I can provide more information to your questions.

  • The table which I am considering is a Delta table with many columns (194 columns)
  • The table is partitioned by two columns
  • The table is large (around 400 mio rows, 2137 files, 18GB of data)
  • The output of the OPTIMIZE ZOrder is a table with path and metrics:
  • See: 
    object
    numFilesAdded: 0
    numFilesRemoved: 0
    filesAdded:
    min: null
    max: null
    avg: 0
    totalFiles: 0
    totalSize: 0
    filesRemoved:
    min: null
    max: null
    avg: 0
    totalFiles: 0
    totalSize: 0
    partitionsOptimized: 2137
    zOrderStats: null
    numBatches: 0
    totalConsideredFiles: 2137
    totalFilesSkipped: 2137
    preserveInsertionOrder: true
    numFilesSkippedToReduceWriteAmplification: 0
    numBytesSkippedToReduceWriteAmplification: 0
    startTimeMs: 1691419395184
    endTimeMs: 1691419396139
    totalClusterParallelism: 8
    totalScheduledTasks: 0
    autoCompactParallelismStats: null
    deletionVectorStats:
    numDeletionVectorsRemoved: 0
    numDeletionVectorRowsRemoved: 0
    numTableColumns: 194
    numTableColumnsWithStats: 32
    totalTaskExecutionTimeMs: 0
    skippedArchivedFiles: 0
    clusteringMetrics: null

Looking at the metrics, it seems that all Files were skipped. It says that partitionsOptimized = 2137. However, this is the first time we are using OPTIMIZE with ZOrder. Hence, I would expect that the OPTIMIZE with ZOrder command would process files. Any further ideas?

Thank you in advance