Reading Delta Metadata In Power Query

There’s a new M function rolling out now that allows you to read metadata from Delta tables (at the time of writing it’s available in Dataflows Gen2 and will be available soon in Desktop). It builds on the DeltaLake.Table M function that allows you to read data from Delta tables and is similar to the Parquet.Metadata function that was released last year. Here’s an example of how to use it to get metadata from a Delta table in OneLake:

let
  Source = AzureStorage.DataLake(
    "https://onelake.dfs.fabric.microsoft.com/insertworkspaceidhere/insertlakehouseidhere/Tables/inserttablenamehere", 
    [HierarchicalNavigation = true]
  ), 
  ToDelta = DeltaLake.Metadata(
    DeltaLake.Table(Source)
  )
in
  ToDelta

The function returns a table of records containing the metadata from the Delta table such as the schema, how the table is partitioned, and whether the table is V-Ordered or not:

3 thoughts on “Reading Delta Metadata In Power Query

  1. This is great. I’m trying to figure out if it’s possible to run this across every table in every lakehouse? It would be great to see in one place a timestamp of when the latest update was.

    1. Yes, it should be possible to do this. The Lakehouse connector in PQ can give you a table containing one row for every table in the Lakehouse, and you then just need to call this function once for each row in this table.

Leave a Reply