exam questions

Exam Certified Data Engineer Professional All Questions

View all questions & answers for the Certified Data Engineer Professional exam

Exam Certified Data Engineer Professional topic 1 question 227 discussion

Actual exam question from Databricks's Certified Data Engineer Professional
Question #: 227
Topic #: 1
[All Certified Data Engineer Professional Questions]

A data engineer wants to refactor the following DLT code, which includes multiple table definitions with very similar code.



In an attempt to programmatically create these tables using a parameterized table definition, the data engineer writes the following code.



The pipeline runs an update with this refactored code, but generates a different DAG showing incorrect configuration values for these tables.

How can the data engineer fix this?

  • A. Wrap the for loop inside another table definition, using generalized names and properties to replace with those from the inner table definition.
  • B. Convert the list of configuration values to a dictionary of table settings, using table names as keys.
  • C. Move the table definition into a separate function, and make calls to this function using different input parameters inside the for loop.
  • D. Load the configuration values for these tables from a separate file, located at a path provided by a pipeline parameter.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Thameur01
1 month, 3 weeks ago
Selected Answer: C
here is a correct implementation: def create_table(t): @dlt.table(name=f"{t}_dataset") def table_definition(): return spark.read.table(t) tables = ["t1", "t2", "t3"] for t in tables: create_table(t)
upvoted 2 times
...
benni_ale
1 month, 4 weeks ago
Selected Answer: C
Problem seems to be the fact that the new_table function has no parameter and the t variable won't be recognized as a variable.. However i have not tested it as DLT is not available in free membership. :(
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago