Stokholm
New Contributor III

Hi @Suteja Kanuri​,

I think you misunderstood my post. The Movement to Delta Lake in Azure Storage did not help. It still showed that everything was being scanned when using the timestamp in the where-clause.

I did not include the partitioned columns themselves in the where-clause, I only include the column(timestamp) that the partitioned columns where derived from.

As per documentation the should make the optimizer able to use the partitionfilter, but it does not.

Delta Lake may be able to generate partition filters for a query whenever a partition column is defined by one of the following expressions:

  • YEAR(col) and the type of col is TIMESTAMP.
  • Two partition columns defined by YEAR(col), MONTH(col) and the type of col is TIMESTAMP.
  • ...

If a partition column is defined by one of the preceding expressions, and a query filters data using the underlying base column of a generation expression, Delta Lake looks at the relationship between the base column and the generated column, and populates partition filters based on the generated partition column if possible.