
Question 34
Which of the following describes the change the colleague needs to make to the query?
A data engineer has written the following query:
SELECT *
FROM json.`/path/to/json/file.json`;
```
The data engineer asks a colleague for help to convert this query for use in a Delta Live
Tables (DLT) pipeline. The query should create the first table in the DLT pipeline.
Which of the following describes the change the colleague needs to make to the query?
*
SELECT *
FROM json.`/path/to/json/file.json`;
```
The data engineer asks a colleague for help to convert this query for use in a Delta Live
Tables (DLT) pipeline. The query should create the first table in the DLT pipeline.
Which of the following describes the change the colleague needs to make to the query?
*
Explanation:
The correct answer is B. They need to add a CREATE LIVE TABLE table_name AS line at the beginning of the query.
Here's the detailed explanation:
In Delta Live Tables (DLT), you define tables using SQL by prefixing standard SQL queries with DLT-specific declarations. The basic syntax for creating a table is:
CREATE LIVE TABLE table_name
AS
SELECT * FROM json.`/path/to/json/file.json`;
CREATE LIVE TABLE table_name
AS
SELECT * FROM json.`/path/to/json/file.json`;
Let's examine why the other options are incorrect:
live. prefix is used to reference other tables within the same DLT pipeline, not to read external data sources.CREATE LIVE TABLE, not CREATE DELTA LIVE TABLE.cloud_files is an excellent function for autoloader-style ingestion and is commonly used in DLT pipelines for incremental processing, it's not strictly required to convert this specific query. The original query using the json. data source will work in DLT when wrapped with the proper CREATE LIVE TABLE syntax. The cloud_files wrapper would be an enhancement for better pipeline performance and incremental processing, but the fundamental change needed is the DLT table creation syntax.The core requirement to convert any standard Databricks SQL query for use in a DLT pipeline is to add the appropriate DLT declaration (CREATE LIVE TABLE..., CREATE LIVE VIEW..., etc.) at the beginning.*
Ultimate access to all questions.