CERTIFIED-DATA-ENGINEER-PROFESSIONAL · Question #16
A table is registered with the following code: Both users and orders are Delta Lake tables. Which statement describes the results of querying recent_orders?
The correct answer is B. All logic will execute when the table is defined and store the result of joining tables to the DBFS;. The table is registered using a CREATE TABLE AS SELECT (CTAS) statement rather than a CREATE VIEW. With CTAS, the query (joining users and orders) is executed immediately at table-creation time, and the resulting data is materialized and written to DBFS (or configured storage). S
Question
A table is registered with the following code:
Both users and orders are Delta Lake tables. Which statement describes the results of querying recent_orders?
Exhibit
Options
- AAll logic will execute at query time and return the result of joining the valid versions of the source
- BAll logic will execute when the table is defined and store the result of joining tables to the DBFS;
- CResults will be computed and cached when the table is defined; these cached results will
- DAll logic will execute at query time and return the result of joining the valid versions of the source
- EThe versions of each source table will be stored in the table transaction log; query results will be
How the community answered
(43 responses)- A5% (2)
- B88% (38)
- C2% (1)
- E5% (2)
Explanation
The table is registered using a CREATE TABLE AS SELECT (CTAS) statement rather than a CREATE VIEW. With CTAS, the query (joining users and orders) is executed immediately at table-creation time, and the resulting data is materialized and written to DBFS (or configured storage). Subsequent queries against recent_orders read from this stored snapshot - they do not re-execute the join logic. This is distinct from a view, which re-executes its defining query each time it is queried. Because both source tables are Delta Lake tables, the snapshot reflects their state at the moment of CTAS execution.
Topics
Community Discussion
No community discussion yet for this question.
