i have created a materialized view table using delta live table pipeline and its not appending data

257 Views Asked by At

i have created a materialized view table using delta live table pipeline , fro some reason it is overriting data every day , i want it to append data to the table insted of doing full refresh suppose i had 8 million records in table and if i run the pipline it will rmeove those previous records and only put in new records. i want it to appends to allready existing data i have tried using @dlt.table(mergeMode="append")it throws unexpected keyword argument error

i have tried using @dlt.table(mergeMode="append")it throws unexpected keyworfd argument error

1

There are 1 best solutions below

0
On

You can use the @append_flow decorator, which is in public preview and allows you to write to a streaming table from multiple streaming sources.

You can use the code below to append values to a materialized view table:

from deltatables import Dlt

@Dlt.table
def my_materialized_view():
    # Your query here (e.g., SELECT * FROM my_source_data)
    pass
@Dlt.append_flow
def my_streaming_pipeline():
    # Your streaming logic here
    pass

  • Use the @table decorator to define both materialized views and streaming tables.

For more information, you can refer to this by @Kaniz.