02-16-2024 03:44 AM
02-16-2024 05:10 AM
Hi @zero234., To ensure that your Delta Live Table pipeline appends data instead of overwriting it, you can use the @append_flow
decorator.
Here are the steps:
Use @append_flow
:
@append_flow
decorator is in Public Preview and allows you to write to a streaming table from multiple streaming sources.Define Materialized Views or Streaming Tables:
@table
decorator to define both materialized views and streaming tables1.Example Usage:
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
Override Default Behavior:
34.02-16-2024 05:10 AM
Hi @zero234., To ensure that your Delta Live Table pipeline appends data instead of overwriting it, you can use the @append_flow
decorator.
Here are the steps:
Use @append_flow
:
@append_flow
decorator is in Public Preview and allows you to write to a streaming table from multiple streaming sources.Define Materialized Views or Streaming Tables:
@table
decorator to define both materialized views and streaming tables1.Example Usage:
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
Override Default Behavior:
34.06-04-2024 01:14 AM
Hi @Kaniz_Fatma,
In my DLT pipeline, I'm using DLT Classic Core as the resource. When I run the DLT pipeline (create silver layer from bronze) for the first time, it will create a Materialized view in silver layer. When there are some rows in the bronze layer been updated, I re-run the DLT pipeline again, I realized that the data in silver layer did reflect the latest changes from bronze layer. However, what I'm not clear is that the Materialized view in silver layer is doing a full refresh or just updating the rows that have changes? I couldn't find any source regarding this topic especially I'm using DLT Classic Core in DLT pipeline without CDC, appreciate your clarification, thank you!
02-17-2024 06:37 PM
@zero234 ,
Adding some suggestion based on answers from @Kaniz_Fatma. Important point to note here: "To define a materialized view in Python, apply @table to a query that performs a static read against a data source. To define a streaming table, apply @table to a query that performs a streaming read against a data source."
I think if you which to read by streaming mode, DLT will treat your destination as streaming table.
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group