[Python] Deltakernel FFI Error while DuckDb Reading Delta

Discussão em 'Python' iniciado por Stack, Junho 6, 2025.

  1. Stack

    Stack Membro Participativo

    Getting an FFI error while trying to read a detla table with Duckdb. The delta table is on a network connected drive via SMB. I just wrote the delta table from the same machine, just prior, using the same python kernel. I wrote the delta table using Polars and wanted to query it using SQL in Duckdb.

    The error is here and I cannot figure it out.


    IOException: IO Error: Hit DeltaKernel FFI error (from: While trying to read from delta table: '....\data\prices_delta/'): Hit error: 8 (ObjectStoreError) with message (Error interacting with object store: Generic URL error: Unable to recognise URL "file://xxx.xxx.x.xxx/airflow/data/prices_delta/")
    ​

    Here's the code that I'm using to query the table. Note that I've also tried absolute paths but the relative pathing works for other duckdb operations (scanning csv/parquet/etc) and I used the relative pathing to write the tables.

    delta_data_folder = '..\\..\\data\\prices_delta'
    Query = f"""
    SELECT count(*)
    FROM delta_scan('{delta_data_folder}')
    WHERE 1=1
    AND year = 2024
    AND month = 8
    AND day = 29
    """
    con = duckdb.connect(database = ":memory:")
    con.execute(Query).df().head()

    Continue reading...

Compartilhe esta Página