Forum Discussion

carlol's avatar
carlol
Icon for Resolver I rankResolver I
1 month ago
Solved

DeltaLake.Table fails on Usage Metrics semantic model because _delta_log contains URL-encoded parque

The solution previously worked and from today every table (Users, Reports, Report Pages, Report Views, etc.) fails at DeltaLake.Table(Source) despite the files and _delta_log being present.   Descrip...
  • carlol's avatar
    1 month ago

    I confirmed all above , as a work around I create this code 

    Latest _delta_log entry:

     

    "path":"Users-28f8e96d-15d0-4ef8-b_%28215434%29.00000000000000000170.parquet"

     

    Physical file:

     

    Users-28f8e96d-15d0-4ef8-b_(215434).00000000000000000170.parquet

     

    Difference:

     

    Delta log contains URL-encoded characters:
    %28 = (
    %29 = )

     

    The AzureStorage.DataLake() file listing returns decoded filenames while DeltaLake.Table() appears to expect the encoded names contained in the Delta log.

     

    Additional evidence:

     

    DeltaLake.Table(Source)
    fails with:
    Expression.Error: The key didn't match any rows in the table. 
    Details
    Reason = Expression.Error
    ErrorCode = 10061
    Key = [Name = "Reports-045af53d-15a1-41ad-a8_%28268%29.00000000000000000174.parquet"]
    Table = #table({"Content", "Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path"}, {})

     

     

    Applying:

     

    FixedNames =
        Table.TransformColumns(
            Source,
            {
                {
                    "Name",
                    each Uri.EscapeDataString(_),
                    type text
                }
            }
        )

     

    and then:

     

    DeltaLake.Table(FixedNames)

     

    successfully returns the table data.

     

    This strongly indicates that the failure is caused by a filename encoding mismatch between the Delta log metadata and the filenames returned by AzureStorage.DataLake().