Difference between LIVE TABLE and STREAMING LIVE TABLE
Asked Answered
O

2

11

When using DLT, we can create a live table with either STREAMING LIVE TABLE or LIVE TABLE, as written in the docs :

CREATE OR REFRESH { STREAMING LIVE TABLE | LIVE TABLE } table_name

What is the difference between the two syntaxes ?

Obvolute answered 27/6, 2022 at 13:45 Comment(0)
S
8

It's described in the documentation, on the Concepts' page.

A live table or view always reflects the results of the query that defines it, including when the query defining the table or view is updated, or an input data source is updated. Like a traditional materialized view, a live table or view may be entirely computed when possible to optimize computation resources and time.

A streaming live table or view processes data that has been added only since the last pipeline update. Streaming tables and views are stateful; if the defining query changes, new data will be processed based on the new query and existing data is not recomputed.

Sinistrodextral answered 1/8, 2022 at 12:9 Comment(1)
It is not clear to me: select * from stream(my_streaming_live_table): will that only return the latest data (that has not been read previously) - or will it return historical as well? If the former then does that mean that one and only client can read from the table? In kafka that is not the case: each consumer has an offset so an arbitrary number of consumers can be simultaneously supported with read-once guarantees.Helle
T
0

when to use "streaming" keyword when creating DLT tables

for ex. create or refresh streaming table table_name

You can only declare streaming tables using queries that read against a streaming source (DLT)

when to use "Live" key word when createing DLT table

Live tables are equivalent conceptually to materialized views. To read from an internal dataset, prepend the LIVE keyword to the dataset name Declaring new tables in this way creates a dependency that Delta Live Tables automatically resolves before executing updates. The live schema is a custom keyword implemented in Delta Live Tables that can be substituted for a target schema if you wish to publish your datasets.

Tibbetts answered 5/3 at 13:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.