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 1 discussion

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

An upstream system has been configured to pass the date for a given batch of data to the Databricks Jobs API as a parameter. The notebook to be scheduled will use this parameter to load data with the following code: df = spark.read.format("parquet").load(f"/mnt/source/(date)")
Which code block should be used to create the date Python variable used in the above code block?

  • A. date = spark.conf.get("date")
  • B. input_dict = input()
    date= input_dict["date"]
  • C. import sys
    date = sys.argv[1]
  • D. date = dbutils.notebooks.getParam("date")
  • E. dbutils.widgets.text("date", "null")
    date = dbutils.widgets.get("date")
Show Suggested Answer Hide Answer
Suggested Answer: E 🗳️

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
hal2401me
Highly Voted 8 months, 3 weeks ago
Selected Answer: E
dbutils.widget. Just passed the exam with score >80%. examtopics covers about 90% of questions. there were 5 questions I didn't see here in examtopics. But friends, you need to look at the discussions, and do test yourself. many answers provided here, even most voted answer, does NOT exists anymore in the exam - not the question, but the answer. Wish you all good luck, friends!
upvoted 12 times
...
Gowtham02
Most Recent 5 days, 3 hours ago
Selected Answer: E
widget is correct
upvoted 1 times
...
KadELbied
1 month, 2 weeks ago
Selected Answer: E
Suretly E
upvoted 2 times
...
ultimomassimo
2 months, 3 weeks ago
Selected Answer: E
E 100% There is no such thing as dbutils.notebooks.getParam, so no idea why some halfwits suggest D...
upvoted 1 times
...
shoaibmohammed3
3 months, 3 weeks ago
Selected Answer: E
dbutils.widgets is where we store all the param and use .get to fetch the params
upvoted 1 times
...
johnserafim
3 months, 4 weeks ago
Selected Answer: D
D is correct! The question states that the upstream system passes the date as a parameter to the Databricks Jobs API. In Databricks, when a parameter is passed to a notebook via the Jobs API, it can be retrieved using the dbutils.notebooks.getParam() method. Option D directly retrieves the parameter value using this method, which is the correct approach for this scenario.
upvoted 1 times
...
EelkeV
4 months, 1 week ago
Selected Answer: E
It is the way to fill in a parameter in a notebook
upvoted 1 times
...
HairyTorso
5 months, 2 weeks ago
Selected Answer: E
Around question #130 they just repeat themselves. So it's not 226 but around 130... Shame
upvoted 2 times
...
akashdesarda
8 months, 3 weeks ago
Selected Answer: E
Jobs API allows to sending parameters via jobs parameter. This parameter must have the same notebook params. Eventually, it can be read using dbutils.widgets.get
upvoted 1 times
...
HorskKos
10 months, 1 week ago
E is correct because: A - gets configuration of a spark session B - gets a value from a manual input - non relevant for the job run C - sys.argv - gets parameters, which were used to run a Pyrhon script from CMD - completely non-related D - haven't found this function on the web at all, assume that it doesn't exist Therefore E is correct, though it's a bad practice to type a date as a parameter, it's better to get it with datetime library and then use it in the code
upvoted 4 times
...
Shailly
11 months, 1 week ago
Answer is E. Even though the value is passed from a upstream system, you can create parameters using widgets inside notebook and use the value as an input from the databricks jobs API.
upvoted 1 times
...
Isio05
1 year ago
Selected Answer: E
Widgets are used to create parameters in notebook that can be then utilized by e.g. jobs
upvoted 1 times
...
imatheushenrique
1 year ago
E. E. dbutils.widgets.text("date", "null") date = dbutils.widgets.get("date")
upvoted 1 times
...
AziLa
1 year, 2 months ago
correct ans is E
upvoted 1 times
...
Sosicha
1 year, 2 months ago
Are you reading the question? It asks about an upstream system that has been configured to pass the date for a given batch of data to the Databricks Jobs API as a parameter. Upstream system usually don't use widgets. Widgets they are made for humans. Only C and D are correct but D is better so D.
upvoted 1 times
...
hal2401me
1 year, 3 months ago
Selected Answer: E
vote for E dbutils.widget
upvoted 1 times
...
AziLa
1 year, 4 months ago
Correct Ans is E
upvoted 1 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 ...