Databricks Data Engineer Associate Question 416
Select 2You are troubleshooting a Delta Live Tables (DLT) pipeline where the execution failed. The error message indicates a syntax issue in a notebook used by the pipeline. After reviewing the notebook, you notice the following CREATE STREAMING LIVE TABLE statement:
CREATE STREAMING LIVE TABLE orders_cleaned
AS
SELECT * FROM orders_raw
What changes should you make to resolve the issue?
- A
Add the keyword LIVE before the table name orders_raw in the FROM clause.
- B
Remove the keyword STREAMING from the CREATE statement.
- C
Replace the SELECT statement with a STREAM keyword in the FROM clause.
- D
Ensure orders_raw is defined as a LIVE table in the pipeline.
Show answer and explanation
Correct answers: A, D
Explanation
In a DLT pipeline, all tables referenced in a CREATE LIVE TABLE or CREATE STREAMING LIVE TABLE statement must be prefixed with the LIVE keyword in the FROM clause. Additionally, the table orders_raw must be defined as a LIVE table within the pipeline to ensure it can be referenced correctly. These changes will resolve the syntax error and allow the pipeline to execute successfully.
- A. Correct.
The keyword LIVE is required before the table name in the FROM clause to reference a DLT-managed table. Without it, the pipeline cannot identify orders_raw as a valid table.
- B. Incorrect.
The keyword STREAMING is valid in the CREATE statement when defining a streaming table, so it does not need to be removed.
- C. Incorrect.
The STREAM keyword is not valid syntax in the FROM clause. Instead, the SELECT statement should remain, referencing the table with the LIVE keyword.
- D. Correct.
If orders_raw is not defined as a LIVE table in the pipeline, the reference will fail. Ensuring it is defined as a LIVE table is necessary for successful execution.