
Ultimate access to all questions.
Which of the following describes the change the colleague needs to make to the query?
A
They need to add a COMMENT line at the beginning of the query.
B
They need to add a CREATE LIVE TABLE table_name AS line at the beginning of the query.
C
They need to add a live. prefix prior to json. in the FROM line.
D
They need to add a CREATE DELTA LIVE TABLE table_name AS line at the beginning of the query.
E
They need to add the cloud_files(...) wrapper to the JSON file path.
Explanation:
To convert a standard SQL query into a Delta Live Tables (DLT) pipeline query, the key change required is to add CREATE DELTA LIVE TABLE table_name AS at the beginning of the query. This syntax is specific to DLT pipelines and tells Databricks that this query should be executed as part of a DLT pipeline.
Let's analyze each option:
A. They need to add a COMMENT line at the beginning of the query. - ❌ Incorrect. While comments can be added for documentation, they are not required to make a query work in DLT.
B. They need to add a CREATE LIVE TABLE table_name AS line at the beginning of the query. - ❌ Incorrect. The correct syntax is CREATE DELTA LIVE TABLE, not just CREATE LIVE TABLE.
C. They need to add a live. prefix prior to json. in the FROM line. - ❌ Incorrect. This would be incorrect syntax for DLT. The live. prefix is not used in this context.
D. They need to add a CREATE DELTA LIVE TABLE table_name AS line at the beginning of the query. - ✅ CORRECT. This is the exact syntax required to define a table in a Delta Live Tables pipeline. The complete syntax would look like:
CREATE DELTA LIVE TABLE table_name
AS
SELECT * FROM json.`/path/to/file.json`
CREATE DELTA LIVE TABLE table_name
AS
SELECT * FROM json.`/path/to/file.json`
E. They need to add the cloud_files(...) wrapper to the JSON file path. - ❌ Incorrect. While cloud_files() can be used for autoloader functionality in DLT, it's not required for all JSON file reads and is not the primary change needed to convert a standard query to a DLT query.
Key Takeaway: Delta Live Tables uses specific syntax starting with CREATE DELTA LIVE TABLE to define pipeline tables, which is different from standard SQL or even Databricks SQL syntax.