
Ultimate access to all questions.
A data engineer has joined an existing project and they see the following query in the project repository:
CREATE STREAMING LIVE TABLE loyal_customers AS
SELECT customer_id -
FROM STREAM(LIVE.customers)
WHERE loyalty_level = 'high';
CREATE STREAMING LIVE TABLE loyal_customers AS
SELECT customer_id -
FROM STREAM(LIVE.customers)
WHERE loyalty_level = 'high';
Which of the following describes why the STREAM function is included in the query?
A
The STREAM function is not needed and will cause an error.
B
The table being created is a live table.
C
The customers table is a streaming live table.
D
The customers table is a reference to a Structured Streaming query on a PySpark DataFrame.
E
The data in the customers table has been updated since its last run.
Explanation:
The STREAM function is used to indicate that the source table (LIVE.customers) is a streaming live table. In Databricks SQL, when creating a streaming live table that reads from another streaming source, you need to use the STREAM() function to specify that the source is a streaming table. This allows the new streaming table to incrementally process data from the source streaming table.
Key points:
STREAMING LIVE TABLE called loyal_customersSTREAM(LIVE.customers) - the STREAM() function wraps the source tableLIVE.customers is itself a streaming tableSTREAM() function, the query would treat LIVE.customers as a static/batch table