nerdexam
Databricks

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

Data Storage and Management

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

CERTIFIED-DATA-ENGINEER-PROFESSIONAL question #16 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)
  • A
    5% (2)
  • B
    88% (38)
  • C
    2% (1)
  • E
    5% (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

#Materialized Views#Delta Lake#Data Persistence#Query Execution

Community Discussion

No community discussion yet for this question.

Full CERTIFIED-DATA-ENGINEER-PROFESSIONAL Practice