0% found this document useful (0 votes)
210 views18 pages

Professional 1

The document contains a series of questions and answers from the Databricks Certified Data Engineer Professional Exam, covering topics such as data ingestion, cluster management, and SQL queries in Databricks. Each question presents a scenario related to data engineering practices and asks for the correct code or configuration to achieve a specific outcome. The document includes a total of 227 questions, with a focus on practical applications of Databricks features and functionalities.

Uploaded by

realme.bpy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
210 views18 pages

Professional 1

The document contains a series of questions and answers from the Databricks Certified Data Engineer Professional Exam, covering topics such as data ingestion, cluster management, and SQL queries in Databricks. Each question presents a scenario related to data engineering practices and asks for the correct code or configuration to achieve a specific outcome. The document includes a total of 227 questions, with a focus on practical applications of Databricks features and functionalities.

Uploaded by

realme.bpy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

1:36 PM A Vo

WiFi (m16 J•
Databricks Certified Data Engineer Professional Exam
PS9e: 1 /4(,
Total 227 questions @
Question 1 ( Exam A )

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').loa<l(f•I mnVsoorce/(date)1
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= mput_dictl"date'J
C. import sys
date = sys.argvflj
D. date = dbutils.notebooks.getParam(~date}
E. dbutils.widgets.text("date", ~null")
date = dbutils.widgets.get("date')

Answer : E

Next Question

Question 2 ( Exam A )

The Oatabricks workspace administrator has configured interactive clusters for each of the data engineenng groups. To control costs,
clusters are set to terminate after 30 minutes of inactivity. Each user should be able to execute workloads against their assigned clusters
at any time of the day.
Assuming users have been added to a workspace but not granted any permissions, which of the following describes the minimal
permissions a user would ne·ed to start and attach to an already configured cluster.

A 'Can Manage• privileges on the required cluster


8. Workspace Admin privileges, cluster creation allowed, 'Can Attach To~privileges on the required cluster
C. Cluster creation allowed, "Can A1tach To~privileges on the required cluster
0. "Can Restart~privileges on the required cluster
E. Cluster creation allowed. "Can Restart~privileges on the required cluster

Answer: D

Next Question

Question 3 ( Exam A )

When scheduling Structured Streaming jobs for production, which configuration automatically recovers from query failures and keeps
costs low?

A. Cluster: New Job Cluster;


Retnes: Unlimited;
Maximum Concurrent Runs: Unlimited
8. Cluster: New Job Cluster,
Retries: None;
Maximum Concurrent Runs: 1
C. Cluster: Existing All-Purpose Cluster;
Retries: Unlimited;
Maximum Concurrent Runs: 1
0. Cluster: New Job Cluster;
Retries: Unlimited;
Maximum Concurrent Runs: 1
E. Cluster: Existing All-Purpose Cluster:
Retries: None;
Maximum Concurrent Runs: 1

Answer : O

Next Question

Question 4 ( Exam A )

The data engineering team has configured a Oatabncks SQL query and alert to monitor the values in a Delta Lake table. The
recenLsensorJecordings table contains an identifying sensorJd alongside the timestamp and temperature for the most recent 5

■ ◄
1:36 PM A Vo
WiFi (m16 J•
Maximum Concurrent Runs: 1
C. Cluster: Existing All-Purpose Cluster;
Retnes: Unflmited;
Maximum Concurrent Runs: 1
D. Cluster: New Job Cluster;
Retries: Unlimited;
Maximum Concurrent Runs: 1
E. Cluster: Existing All-Purpose Cluster:
Retries: None;
Maximum Concurrent Runs: 1

Answer: 0

Next Question

Question 4 ( Exam A )

The data engineering team has configured a Oatabncks SOL query and alert to monitor the values in a Delta Lake table. The
recenLsensor_recordings table contains an identifying sensoUd alongside the timestamp and temperature for the most recent 5
minutes of recordings.
The below query is used to create the alert:
S£L£CT Me.}.N(~emperature ), MAX (~-=.mperature ) , M!N(cemperature)
FROM recenc_sensor_recording s
GROUP BY sensor id
The query is set to refresh each minute and always completes in less than 10 seconds. The alert is set to trigger when mean
(temperature) > 120. Notifications are triggered to be sent at most every 1 minute.
If this alert raises notifications for 3 consecutive minutes and then stops, which statement must be ttue?

A. The total average temperature across all sensors exceeded 120 on three consecutive executions of th-e query
B. The recenLsensor_recordings table was unresponsive for three consecutive runs of the query
C. The source query failed to update property for three consecutive minutes and then resiarted
D. The maximum temperature recording fer at least one sensor exceeded 120 on three consecutive executions of the query
E. The average temperature recordings for at least one sensor exceeded 120 on three consecutive executions of the query

Answer: E

Next Question

Question 5 ( Exam A )

A junior developer complains that the code in their notebook isn't producing the correct results in the development environment. A shared
screenshot reveals that while they're using a notebook vers1oned with Oatabricks Repos, they're using a personal branch that contains old
logic. The desired branch named dev-2.3.9 is not available from the branch setection dropdown.
Which approach wi!I allow this de'leloper to revie>N the current logic for this notebook?

A. Use Repos to make a pull request use the Databricks REST APt to update the current branch to dev-2.3.9
8. Use Repos to pull changes from th.e remote Git repository and select the dev-2.3. 9 branch.
C. Use Repos to checkout the dev-2.3.9 branch and auto-resolve conflicts with the current branch
0. Merge all changes back to the main branch in the remote Grt repository and clone the repo agam
E. Use Repos to merge the current branch and the dev-2.3.9 branch.. then make a pull request to sync with the remote repository

Answer: B

Next Quest1-0n

Page: 1 /%
Next Page @
Total 227 questions

CONNECT WITH US

f Facebook

-I Twitter

Youtube

Qi suppcn@1texams com

■ ◄
1:36 PM A Vo
WiFi (m16 J•

Databricks Certified Data Engineer Professional Exam


PS9e: 2 / 4(, 0
Total 227 questions 0
Question 6 ( Exam A )

The security team is exploring whether or not the Oatabricks secrets module can be leveraged for connecting to an external database.
After testing the code with all Python variables being defined with strings, they upload the password to the secrets module and configure
the correct permissions for the currently active user. They then modif)' their code to the following Oeaving all other variables unchanged).

d! .., l1tJ:: rlt


,tshi
!om.ar: "i'lbe")
.~p!i~ol"~rl". coruuac.•onJ
.r:p"'ler: J" 1bra.~,,..,4 ~4h·""r,4m~l
Ct lOt'l. "'--"-" 1 l,, ! I Q ~ j
,rption "pi,~V?ri", pa~r.rord)

Which statement describes what will happen when the above code is executed?

A. The connection to the external table wdl fail: the string '"REDACTED' will be printed.
8. An interactive input box will appear in the notebook; if the right password is provided, the connection will succeed and the encoded
password will be saved to OBFS.
C. An interactive input box will appear in the notebook; if the right password is provided, the connection will succeed and the pass•.vord
w1II be printed in plain text.
D. The connection to the external table will succeed; the st.ring value of password wm be printed in plain text.
E. The connection to the external table will succeed; the string "REDACTED" will be printed.

Answer : E

Next Question

Question 7 ( Exam A )

The data science team has created and logged a production model using Mlflow. The following code correctly imports and applies the
production model to output the predictions as a new OataFrame named preds with the schema •customerjd LONG, predictions DOUBLE,
date DATE'.

moils 11111 (w,p,_r!u.ne . ti ► <lU_•~1tt~;;.rk . I!! ;,.J_ur ...ffll)t.lnllciiirri/t-J, d " )


d:- - :,r,9:r:.C.rat,l~t"'co.,ccn,~r~"'
cc:J~c.ne • r~acco-10• age•, ~tim~ ,tnce la~t se~r.· , "apt, rat nq "J
pr.,d~ - (dt.~•1•ctf
" c: Dt ml!.c Jd" 1
ffl Utrl ( "' co WIU'I!! J • •ll .U I "pt.ti •H ct! n-'" I ,

eurr~nt ia~@().al1•~t•da:e~l

The data science team would like predictions saved to a Oelta Lake table with the ability to compare all predictions across time. Churn
predictions wiU be made at most once per day.
Wh.ich code block accomplishes this task while minimizing potential compute costs?

A. preds.vmte.rnode(:'append").saveAsTable("churn_preds")
B. pre<ls.write.format(°oelta').save('/preds/churn_preds' )

....lJtpl.lto/odr i ,.,.'n"r"it!r4 r-r"

C. ,r:llt'ftl"t_ • c~ in.tF,st.b", •I e-:lcflwlr!t• vut-o_pt-.11"•


•t<\ rt t • '_prt'd :1- ::n,ic-n _J=T"'d.." •

Jpno, vr t ..
t .ar 1•rMlr•" 1
0, .~I'! l"'""""N!'tt..-"I
!IIAYAA11Tillll I'll ('"rl': ;"' _pn,,,,t"-"

1prej~ ~~~eestceA.~
C'Ut'$:'ll'tt!C<'e c••~PtDO" I
E. ,.::pt !.O!' f "n,t-r.~ "t-f'at.l'I ". .. f _ ct'.e;:iry~1 n"' • en.urn_ i-e".S•"l
ta»!.e f"ctn~n, p~-ed<i'"

Answer : A

Next Question

Question 8 ( Exam A ) ,._IL

An upstream source writes Parquet data as hourly batches to directories named with the current date. A nightly batch Job runs the

■ ◄
1:37 PM A Vo
WiFi (m16 J•

Question 8 ( Exam A )

An upstream source writes Parquet data as hourly batches to directories named with the current date. A nightly batch job runs the
following code to ingest all data from the previous day as indicated by the date variable:
(~parlic . rea/j
r r ...1it 1•p;sr .pl.,.t" :
.. ln.adr!"' ~ t ~•w cr~.r:!!/ld•'"• "l
,tfrtpDllp At !'I " l r :a»r ,1.. , " t-r'd•r d,· I
.Wt'i'!.,:,,
, 111(W'Jn I • &p-f.'(' o!J" )
. .1'•v•~l'•t "'l .."i::1•,.., " I

'
Assume that the ftelds customer_id and orderj d serve as a composite key to uniquely identify each order.
If the upstream system is known to occasionally produce duplicate entries for a single order hours apart, which statement is correct?

A. Each write to the orders table will only contain unique records, and only those records without duplicates in the target table will be
written.
B. Each write to the orders table will only contain unique records, but newly written records may have duplicates already present in the
target table.
C. Each write to the orders table will only contain unique records; if existing records with the same key are present in the target table,
these records will be overwritten.
0. Each write to the orders table will only contain unique records; if existing records with the same key are present fn the target table, the
operation will fail.
E. Each write to the orders table wlll run de:duplication over the union of new and existing records, ensuring no duplicate records are
present.

Answer: B

Next Question

Question 9 ( Exam A )

A junior member of the data engineering team is ex.ploring the language interoperability of Oatabricks notebooks. The intended outcome
of the below code is to registet a view of all sales that occurred in count1ies on the continent of Africa that appe.ar in the geo_lookup
table.
Before executing the code, running SHQV,i'TA8lfS on the current database indicates the database contains only two tables: geo_lookup
and safes.
Cmd1
ltpy•h"ll
ec.l.lnl1.iu_.t • FxlOl ::c1. .x u
.,rar11: .... ,1, I,.« "':J&C_ c-~,l(lJ{ "') • fil ,..., rt · con· l n-tinr- 'IIP'' '") • l!,..1 f"o .. 1·ecun• '"Y'" J •eol he-- {l J

Cmd2
eql
r,;;:.u.,! '-'lfW Hle=_•!" ',S
~P:tEi':"T" •
rRt>.H !!<lle:
~at.Rt c_t~ ~N co1mtr e& ar
Alff Nt1N1.N • "A ..
Whjch statement correctty describes the outcome of executing these command cells m order in an interactive notebook?

A. Both commands will succeed. Executing show tables will show that oountries_af and sales_af have been registered as views.
B. Cmd 1 will succeed. Cmd 2 wlll search all accessible databases for a table or view named countries_af: if th.is entity exists. Cmd 2 will
succeed.
C. Cmd 1 will succeed and Cmd 2 will fall. countries_af will be a Python variable representing a PySpark DataFrame.
0. Both commands will fail. No new variables, tables, or views will be cceated.
E. Cmd 1 will succeed and Cmd 2 wi!I fail. countries_af will be a Python variable containing a list of stnngs.

Answer: e.

Next Question

Question 10 ( Exam A )

A Delta table of weather records is partitioned by date and has the below schema: date DATE, devicejd INT, temp FLOAT. latitude FLOAT,
longhude ROAT
To find all the records from within the Arctic Circle, you execute a query with the below filter: latitude> 66.3
Which statement describes how the Delta engine identifies which files to load?

A. All records are cached to an operational database and then the filter is applied
B. The Parquet file footers are scanned for min and max statistics for the latitude column
C. All records are cached to attached storage and then the ftlter is applied
D. The Delta log is scanned for min and max statistics for the latitude column
E. The Hive metastore is scann-ed for min and max statistics for the latrtude column

Answer : D

■ ◄
1:37 PM A Vo
WiFi (m16 J•
Page: 3/46 O a\ IL ') J"'I.. ®
Total 227 questions '::I '\;;I ,.- • e' .

Question 11 ( Exam A )

The data engineering team has configured a job to process customer requests to be forgotten (have their data deleted). AU user data that
needs to be deleted is stored in Delta Lake tables using default table settings.
The team has decided to process all deletions from the previous week as a batch Job at 1am each Sonday. The total durabon of this job is
less than one hour. Every Monday at 3am, a batch Job executes a senes of VACUUM commands on all Detta Lake tables throughout the
organization.
The compliance officer has recently learned about Delta Lake's time travel functionality. They are concerned that this might allow
continued access to deleted data.
Assuming all delete logic is correctly implemented, which statement correctly addresses this concern?

A. Because the VACUUM command permanentfy deletes all files containing deleted records, deleted records may be accessible with time
travel for around 24 hours.
8 . Because the default data retention threshold is 24 hours. data files containing deleted records will be retained until the VACUUM job is
run the following day.
C. Because Delta l ake time travel provides full access to the entire history of a table, deleted records can always be recreated by users
with full admm privileges.
D. Because Delta lake's delete statements haYe ACID guarantees, deleted records will be permanently purged from all storage systems as
soon as a delete j ob completes.
E. Because the default data retention threshold is 7 days, data files containing deleted records will be retained until the VACUUM job is run
8 days later.

Answer : E

Next Question

Question 12 ( Exam A ) ,.."


A j unior data engineer has configured a workload that posts the following J SON to the Data bricks REST API endpoint 2.0/jobs/create.
(
*nu•: •r.ng~~, n~w G•t•"•
•~x1ac1r.g =4c~c~r 11•: #601S 55441 r•ace11Q#.
-r.~t•tci~k_~~~k•t
"n<tel:xi.lr i:::atl:"': " ti•ri:-d/in=1""~-.py'"

Assuming that all configurations and referenced resources are available, which statement describes the result of executing this workload
three times?

A. Three new jobs named "Ingest new data" will be defined in the workspace, and they will each run once daily.
B. The logic defined in the referenced notebook will be executed three times on new clusters with the configurations of the provided
cluster ID.
C. Three new jobs named "Ingest new data• will be defined in the workspace. but no jobs will be executed.
D. One new job named ~Ingest new data· will be defined in the workspace, but it will not be executed.
E. The logic defined in the referenced notebook will be executed three times on the referenced existing all purpose cluster.

Answer : C

Next Question

Question 13 ( Exam A )

An upstream system is emitting change data capture (CDC) logs that are being written to a cloud object storage directory. Each record in
the log indicates the change 1ype (insert. update, or delete) and the values for each field after the change. The source table has a primary
key identifie<I by the field pk_id.
For auditing purposes, the data governance team wishes to maintain a full record of all values that have ever been valid in the source
system. For analytical purposes. only the most recent value for each record needs to be recorded. The Databricks j ob to ingest these
records occurs once per hour, but each individual record may have changed multiple times over the course of an hour.
Which solution meets these requirements?

A. Create a separate history table for each pk_td resolve the current state of the table by running a umon all flttenng the history tables for
the mos, recent state~
B. Use MERGE INTO to insert, update, or delete the most recent entry for each pk_id into a bronze table, then propagate all changes
throughout the system.
C. Iterate through an ordered set of changes to the table, applying e-ach in turn; rely on Delta lake's versioning ability to create an audit
log.
D. Use Delta Lake's change data feed to automatically process COC data from an external system, propagating all changes to all
dependent tables in the lakehouse.
E. lngest all log information into a bronze table; use MERGE INTO to insert update, or delete the most recent entry for each pk_id into a
silver table to recreate the current table state.

Answer: E

■ ◄
1:37 PM A Vo
WiFi (m16 J•

o- Certifi ed •••
X V -o
itexam s.com
•• •

Next Question

Question 14 ( Exam A )

An hourly batch job is configured to ingest data files from a cloud object storage container where each batch represent all records
pcoduced by 1he source system in a given hour. The batch job to process these records into the Lakehouse is sufficiently defa;•ed to
ensure no late-arri,..ing data is missed. The userjd field represents a unique key for th-e data, which has 1he following schema: user_id
BIGINT, username STRING. user_utc STRING, userJegion STRING, lasUogin BIGINT, auto_pay BOOLEAN, last_updated BIGINT
New records are all ingested into a table named account_history which maintains a full record of all data in the same schema as the
source. The next table in the system is named account_current and is implemented as a Type 1 table representing the most recent value
for each unique user_id.
Assuming there are millions of user accounts and tens of thousands of records. processed hourly, which implementation can be used to
efficiently update the described account_current table as part of each hourly batch job?

A. Use Auto Loader to subscribe to n-ew files in the account_history directory, configure a Structured Streaming trigger once job to batch
update newty detected files into the account_current table.
B. Overwrite the account_current table with each batch using the results of a query against the accounLhistory table grouping by user_id
and filtering for the max value of lasLupdated.
C. Fitter records in accounLhistory using the !asLupdated field and the most recent hour processed1 as well as the max lasUogin by
us.er_1d write a merge statement to update or insert the most recent value for each user_id.
D. Use Delta lake version history to get the drfference between the latest version of account_history and one version prior, then write
these records to acoount_current.
E. Filter records in accounLhistory using the lasLupdated field and the most recent hour processed, making sure to deduplicate on
us.ername; write a merge statement to update or insert the most recent value for each username.

Answer : C

Next Quest1on

Question 15 ( Exam A )

A table in the l akehouse named customer_chum_params is used in churn prediction by the machine learning team. The table contains
information about customers derived from a number of upstream sources. Currently, the data engineering team populates this table
nightly by ove1writing the table with the current valid ,aJues derived from upstream data sources.
The churn prediction model used by the Ml team is fairly stable in production. The team is only interested in making predictions on
records that have changed in the past 24 hours.
Which approach would simplify the identification of these changed records?

A. Apply the chum model to all rows in the customer_churn_params table, but implement logic to perform an upsert into the predicuons
table that ignores rows where predictions have not changed.
B. Convert the batch job to a Structured Streaming job usmg the complete output mode; configure a Structured Streaming job to read
from the customer_churn_params table and incrementally predict against the chum model.
C. Calculate the difference between the previous model predictions and the current customer_chum_params on a key identifying unique
customers before making new predictions; only make predictions on those customers not in the previous predictions.
D. Modify the overwrite logic to include a field populated by calling spark.sql.functions.current_timestampQ as data are being wntten; use
this fretd to identify records written on a particular date.
E. Replace the current overwrite logic with a merge statement to modify only those records that have changed; write logic to make
predictions on the changed records identified by the change data feed.

Answer: E

Next Question

Page: 3 / 46
Total 227 questions
e Previous Page Next Page @

CONNECT WIT H US

f Faceboolc

't# Twiner

■ ◄
1:38 PM A Vo
WiFi (m1s J•

o- Certified •••
X V -o
itexams.com
•••

IT ,xams Exam code or name...

Databricks Certified Data Engineer Professional Exam


Page: 4/ 46
Total 227 questions

Question 16 ( Exam A )

A table is registered with the following code:


C:RE.i\TF. - ;.l:I:[, ri=-oent._ d~r" "AS \
SELEC'7 .u,
r_,.d, a.e:-u!.a.. b. ir::J,.r_id., b . ora~r_dat<!
[Fat'
cstt[CT .1:,iac_1.j, gi.;ail
no.v i..,ar s •
IflNF.~ 'Ol:f
•SFLEC- 10 .. t :S. c "' ld ~ r1••t h •
!Rr.M or:Jer~
WHE P.T. otqor_~~t• l<-" ,. nr _ :h,1'• o - 1J 1 b

Both users and orders are Delta Lake tables. Which statement describes the results of querying recenlorders?

A. All logic will execute at query time and return the result of joining the valid \'ersions of the source tables at the time the query finishes.
B. AU logic will execute when the table is defined and store the result of joining tables to the OBFS: this stored data wilt be returned whe-n
th.e table is queried.
C. Results will be computed and cached when the table is defined; these cached results will incrementally update as new records are
inserted into source tables~
0. AU logic will execute at query time and return the result of joining the valid versions of the source tables a1 the time the query began.
E. The versions of each source table will be stored in the table transaction log; query results will be saved to oer=s with each query.

Answer: 8

Next Question

Question 17 ( Exam A )

A production workload incrementally applies updates from an e-xtemal Change Data Capture feed to a Oetta t ake table as an always-on
Structured Stream job. When data was initialfy migrated for this table; OPTIMIZE was executed and most data files were resized to 1 GB.
Auto Optimize and Auto Comp-action were both turned on for the stre.aming production job. Recent review of data files shows that most
data files are under 64 MB, although each partition in the table contains at least 1 GB of data and the total table size is over 10 TB.
Which of the following likely explains these smaller file sizes?

A. Databricks has autotuned to a smaller target file size to reduce duration of MERGE operations
B. Z·order indices calCtJlated on the table are preveming file compaction
C. Bloom filter indices calculated on the table are pr.eventing f1te compaction
0. Oatabricks has autotuned to a smaller target file size based on the ove-rall size of data in the table
E. Oatabricks has autotuned to a smaller target file size based on the amount of data in each partition

Answer : A

Next Question

Question 18 ( Exam A )

Which statement regarding stream-stauc joins and static Oetta tables 1s correct?

A. Each microbatch of a stream-static j oin will use the most recent version of the static Oetta table as of each microbatch.
B. Each microbatch of a stream-static join will use the most recent version of the static Delta table as of the j ob's initialization.
C. The checkpoint directory will be used to track state information for the unique keys present in the join.
0. Stream-static j oins cannot use static Detta tables because of consistency issues.
E. The checkpoint directory will be used to track updates to the static Oetta table.

Answer : A

Next Question

■ ◄
1:38 PM A Vo
WiFi (m1s J•

o- Certifi ed •••
X V -o
itexams.com
•• •

Answer : A

Next Question

Question 19 ( Exam A )

A junior data engineer hes be.en asked to develop a streaming data pipeline with a grouped aggregation using OataFrame df. The pipeline
needs to calculate the average humidity and average temperature for each non-overlapping five-minute interval. Events are recorded once
per minute per device.
Streaming DataFrame df has the following schema:
'devicejd INT. evenu ,me TIMESTAMP. temp FLOAT, humidity FLOAT'
Code block:
C ! -"~ ':l'.lol'.a,.,_.t I "-•r,• t • IJM" "
• ,11 tif'V I

.,,.., , .. , ~ -) ... ,0•4•11"iJ ..~-1 ~


AY:11~:n.td •Y'}.aH.Ul".l Q t,,.lffl.11.lty"')

•"' ~,..;rJ-,a~
, ,t - 1"j.. .... !
, .V!"J,~Ta.t:l~t" ,-eri •r-_1 •9'"1
Choose the response that correctly fills m the blank within the code block to complete this task.

A. to_intef'lal("evenLtime•, ·s minutes").alias('time")
B. window{"eventJime.., ·s minutes '}.alias("time~}
C. ·event_time"
D. window\ evenLtime, ' 10 minutes/.eliasrtime~)
E. lag('evenUime•, '10 minutes').alias('time')

Answer: B

Next Question

Question 20 ( Exam A )

A data architect has designed a system in which two Structured Streaming jobs will concurrently write to a single bronze Delta table. Each
job is subscribing to a different topic from an Apache Kafka source, but they will write data with the same schema. To keep the directory
structure simple, a data engineer has decided to nest a checkpoint directory to be shared by both streams.
The proposed directory structure is displayed below:
1bmme
checkpolo,
_deltaJog
yHt WH-k~2020 01
yt.ar_week•202C_02

Which statement describes whether this checkpoint directory structure is valid for the given scenario end why?

A. No; Delta Lake manages streaming checkpoints in the transaction log.


B. Yes; both of the streams can share a single checkpoint directory.
C. No; only one stream can write to a Delta l ake table.
D. Yes: Delta l ake supports infinite concurrent writers.
E. No; each of the streams needs to have its own checkpoint directory.

Answer : E

Next Question

P09e: 4/ 46
Total 227 questions
E) Previous Page Next Page @

CONNECT WITH US

f f acebook

W Twitter

_. supportx;:iitexams.com

■ ◄
1:38 PM A

o- Certified •••
X V -o
itexams.com
•• •

IT ,xams Exam code or nam e...

Databricks Certified Data Engineer Professional Exam


Page: 5/46
Total 227 questions

Question 21 ( Exam A)

A Structured Streaming j ob deployed to production has been experiencing delays during peak hours of the day. At present, during normal
execution, each microbatch of data is processed in less than 3 seconds. During peak hours of the day, execution time for each
miCiobatch becomes •1ery inconsistent. sometimes exceeding 30 seconds. The streaming write is currently configured with a trigger
Interval or 10 seconds.
Holding all other variables constant and assuming records need to be processed In less than 10 seconds, which adjustment wlll meet the
requtrement?

A. Decrease the trig-ger interval to S seconds; triggering batches more frequently allows idle executors to begin processing the next batch
while longer running tasks from previous batches finish..
B. Increase the trigger interval to 30 seconds; setting the trigger interval near the maximum execution time obseived for e.ach batch is
always best practice to ensure no records are dropped.
C. The trigger interval cannot be modified without modify;ng the checkpoint directory; to maintain the current stream state, increase the
number of shuffle partitions to maximize parallelism.
0. Use th.e trigger once option and configure a Oatabricks job to execute the QUerJ every 10 seconds; this ensures all backlogged records
are processed with each batch.
E. Decrease the trigger interval to 5 seconds: triggering batches more frequently may prevent records from backing up and large batches
from causing spill.

Answer : E.

Next Quest1-0n

Question 22 ( Exam A )

Which statement describes Delta Lake Auto Compaction?

A. An asynchronous j ob runs after the write completes to detect if fi!es could be further compacted; if yes, an OPTIMIZEjob is executed
toward a default of 1 GB.
B. Before a Jobs duster termmates, OPTJMIZE is executed on all tables modified during the most recent job.
C. Optimized writes use logical partrtions instead of directory parbtions: because partition boundaries are only represented In metadata,
fewer small files are written.
0. Data is queued in a messaging bus instead of committing data directly to memory, all data is oommitted from the messaging bus in
one batch once the job is complete.
E. An asynchronous job runs after the write completes to detect if files could be further compacted; if yes, an OPTIMIZE j ob is executed
toward a default of 128 MB.

Answer: E

Next Question

Question 23 ( Exam A )

Which statement charactenzes the general programming model used by Spark Structured Streaming?

A. Structured Streaming leverages the parallel proce.ssing of GPUs to achieve highly parallel data throughput.
B. Structured Streaming is implemented as a messaging bus and is derived from Apache Kafka.
C. Structured Streaming uses specialized hardware and 1/0 streams to achieve sub-second latency for data transfer.
0. Structured Streaming models new data arriving in a data stream as new rows appended to an unbounded table.
E. Structured Streaming relies on a distributed network of nodes that hold incremental state values for cached stages.

Answer: D

Next Question

Question 24 ( Exam A)

■ ◄
1:38 PM A Vo
WiFi (m1s J•

Which statement characterizes the general programming model used by Spark Structured Streaming?

A. Structu1ed Streaming leverages the parallel processing of GPUs to achieve highly parallel data throughput.
B. Structured Streaming is implemented as a messaging bus and is derived from Apache Kafka.
C. Structured Sueaming uses specialized hardware and 1/0 streams to achieve sub-second latency for data transfer.
D. Structured Streaming models new data a11iving in a data stream as ne\\l rows appended to an unbounded table.
E. Structured Streaming relies on a distributed network of nodes that hold incremental state values for cached stages.

Answer: D

Next Question

Question 24 ( Exam A)

Which configuration parameter directly affects the size of a ::;part<.·partition upon ingestion of data into Spark?

A. spark.sql.flles.maxPartttionBytes
8. spark..sql.autoBroadcastJoinThreshold
C. spar1<.sql.f1les.openCos1ln8ytes
0. spark.sql.adaptive.coa!escePartitions.minPartitionNum
E. spark.sql.adaptive.advisoryPartitionSizefnBytes

Answer: A

Next Question

Question 25 ( Exam A )

ASparkjob is taking longer than expected. Using the Spark UI, a data engineer notes that the Min, Median,. and Max Durations for tasks in
a particular stage show the minimum and median time to complete a task as roughly the same, but the max duration for a task to be
roughly 100 times as long as the minimum.
Wh.ich situation is causing increased duration of the overall job?

A. Task queueing resulting from Improper thread pool assignment.


8. Spill resulting from attached volume storage being too small.
C. Network latency due to some cluster nodes being in different regions from the source data
0. Skew caused by more data being assigned to a subset of spark-partitions.
E. Credential validation errors while pulling data from an external system.

Answer : D

Next Question

Page: 5 / 46
Total 227 questions
(E) Previous Page Next Page (:!)

CONNECT WITH US

f Facebook

't# Twitter

Q} [email protected]

■ ◄
1:40 PM A

o- Certifi ed •••
X V -o
itexams.com
•• •

Databricks Certified Data Engineer Professional Exam


Page: 6/% r.:'.\
Total 227 questions 0
Question 26 ( Exam A ) ,.rt
Each configuration below is identical to the extent that each cluster has 400 GB total of RAM, 160 total cores and only one Executor per
VM.
Given a job with at least one wide transformation, vthich of the following cluster configurations will result in maximum performance?

A. • Total VMs; 1
• 400 GB per Executor
• 160 Cores/ Executor
B. • Total VMs: 8
• 50 GB per Execulor
• 20 Cores / Executor
C. • Total VMs: 16
• 25 GB per Executor
• 10 CoreS/Executor
D. • Total VMs: 4
• 100 GB per Executor
• 40 Cores/Executor
E. • Total VMs:2
• 200 GB per Executor
• 80 Cores / Executor

Answer: A

,' Next Question

Question 27 ( Exam A )

A junior data engineer on your team has implemented the following code block.
Ml. t Ni •v•nr-
oQ'n;-; n,Qv_;;i._,,,nt:ia
01( ev!'!n- ~.•~~:"tt td - new •v0 ?1r-:, . ~v"° ....1: td
~M'!:li .M>~ MJ.'tCHtD:
tJSEr
The view new_events contains a batch of records with the same schema as the events Delta table. The evenUd field seives as a unique
key for this table.
When this query is executed, what will happen with ne•N records that have the same evenUd as an existing record?

A. They are merged.


B. They are ignored.
C. They are updated.
D. They are inserted.
E. They are deleted.

Answer : B

Next Question

Question 28 ( Exam A )

A junior data engineer seeks to leverage Delta Lake's Ch.ange Data Feed functionality to create a Type 1 table representi119 all of the values
that have e•,er been •1alid for all rows in a bronze table created with the property delta.enableChangeOataFeed =- true.They plan to execute
the following code as a daily job:
from pyapark . sql . funct.icna impor, col

(apat rl(. r<1ad . format ("delta " )


. option ( " readChangefeed" , .. crue " )
. option ( 1' :!ltartingVer~ion", O}
. table ( " bronze " )
. filter (col ( "_change_type " ) • i:,1n ( [ "upda te_po:,t.image", " in:,ert. " ) I J
. wri ce
.mode ("append")
.t:able( " bronze hiat:ory t:ypel ")

■ ◄
1:41 PM A
u . 11,eya1e11,111v1eu.
C. They are updated.
D. They are inserted.
E. They are deleted.

Answer : B

'
Next Question

Question 28 ( Exam A )

A junior data engineer seeks to leverage Delta Lake's Change Data Feed functionality to create a Type 1 table representi11{1 all of the vatues
that have ever been valid for all rows in a bronze table created with the property delta.enableChangeOataFeed = true. They plan to execute
the following code as a daily job:
: rom pyspark . sql . functions imporc col

(spark . read . format (''delta")


. option ( " re.adChangeFeed'' , " crue ., )
. option( 11 ~tartinqVer.s1.on", 0)
. cable ( " bronze " )
. fil t:er (col ( "_change _ t:yp,a " I . isin ( ! "updat<a_posi: image" , "insert:" J) I
.write
. mod-. ("append" )
. t.able( "bronze_history_typel " l
I
Which statement describes the execution and results of running the above query multiple times?

A. Each time the j ob is executed, newly updated records will be merged into the target table, overwriting previous values with the same
primary keys.
B. Each time the job is executed, the entire available history of inserted or updated records will be appended to the target table, resulting
in many duplicate entries.
C. Each time the j ob is executed, the target table will be overwritten using the entire history of insened or updated records, giving the
desired resufL
D. Each time the job is executed,. the differences between the original and current versions are calculated; this may result in duplicate
entries for some records.
E. Each time the job is executed, only those records that ha'le been inserted or updated since the last execution will be appended to the
target table, givmg the desired result

Answer : B

Next Question

Question 29 ( Exam A )

A new data engineer notices that a critical field was omitted from an application that writes its Kafka source to Delta l ake. This happened
even though the critical field was in the Kafka source. That fre!d was further missing from data written to dependent. long-term storage.
The retention threshold on the Kafka service is seven days. The pipeline has been in production for three months.
Wh.ich describes how Delta Lake can help to avoid data loss of this nature in the future?

A. The Delta log and Structured Streaming checkpoints record the fu!I history of the Kafka producer.
B. Delta t ake schema evolution can retroactively calculate the correct value for newly ad<led fields, as long as the data was in the original
source.
C. Detta l ake automatically checks that all fields present in the source data are mcluded m the ingestion layer.
0, Data can never be peml anently dropped or deleted from Delta Lake, so data loss is not possible under any circumstance.
E. Ingesting all raw data and metadata from Kafka to a bronze Delta table creates a permanent, repleyable history of the data state.

Answer : E

Next Question

Question 30 ( Exam A )

A nightly j ob ingests data Into a Oetta Lake table using the following code:
fr~ r.rr r\.~o .f~nct1cr.~ ·...-~~ curr•n• _~j!!M!'•t•JC9, rfrJt f1l•_n.11,~, .;:,]
h:o:a r:,:-=p.it)t • .Jql.col,.11r 1nrpotl c~ ... m

rill'f' n.,;..;3,t_.:..:ly_rat....nlt.!.!:Ui_Ci;,_: e-_1..mn. v~-r:i:-it. ,u,ne. u.nt., u..y:Jntl ~

t 1!p1rk, reild
• .l:Gr::',>lt I ..p,Uq-.JOt "I

..
.J.!l•dti'"/tant d.\,1.J.y_baccl11tyeu 11month1
"

• r •
\J.av *I

■ ◄
1:41 PM A Vo
WiFi (m1s J•

Answer : B

Next Question

Question 29 ( Exam A )

A new data engineer notices that a critical field was omitted from an application th.at writes its Kafka source to Delta Lake. This happened
even though the critical field was in the Kafka source. That field was further missing from data written to dependent.. long-term storage.
The retention threshold on the Kafka ser·,ice is seven days. The pipeline has been in production for three months.
Which describes how Delta lake can help to avoid data loss of this nature in the future?

A. The Delta log and Structured Streaming checkpoints record the full history of the Kafka producer.
8. Delta t ake schema evolution can retroactively calculate the correct value for newly added fields, as long as the data was in the original
source.
C. Delta Lake automatically checks that all fields present in the source data are included In the ingestion layer.
0. Data can never be permanentl)' dropped or deleted from Delta Lake, so data loss is not possible under any circumstance.
E. Ingesting all raw data and metadata from Kafka to a bronze Delta table creates a permanent, rep!ayable history of the data state.

Answer : E

Next Question

Question 30 ( Exam A )

A nightly job ingests data imo a Oetta Lake table using the following code:
fr~~ r.1~r~ ~-• .t~ncr en~ •~~ ~ c~rr•nt_t1T"ll!at
ucm F"Y!'!P,.i:;,..:,q •• ol.<..:111 lm~".r c.,..,.,
<h•f MZa3t._:l.tit....:.y_catctaltJJ11o_cc_: :c... .mi:1, y1,oca.nt. 11,t nc.n:i:-:t, aaya.nt \:
(:,-r;ar.C,rea~
. ti:a::r.a: I ",i.uq.;.et" I
• loAd Ir /lilnt lduly_tot~I!/ \year} /{mcnth I ' -i•'I: "I
•se ec: •••
'
<IT"!"" flnt.~1• ... ~ •1nq•~r. - 1ffl"">,
JU;iat-,_ I , l..,_ri • ~ I I , • 1 ha ( " ''- .u ,.~_ t .._)# •

,"1'r-t•
.-:r c-::>e 1• •FPen<:")
,,•.a AJl'l'al: e( " b_.;;.r.ze"'I
)
The next step in the pipeline requires a function that returns an object that can be used to manipulate new records that have not yet been
processed to the next table in the pipeline.
Which code snippet completes this function definition?
def new_recordsQ:

A. return spark.readStre-am.table('bronze~)
B. return spark.readStream.loadC'bronzej
-e•ur~ (5~~r• ~~Ad
r a.bl.,. l "'tr o."1~*~
C.
.t1 ...r~c-(co1t"iri1Jes't. - ,.,.... .. - -u~.renr- t. l!'l'}!lrmnr(l I
I
0. return spark.read.option("readChangeFeed", "true~).table {'bronze'}
~~~ucn 1.,-po~~ reA~
t-~le C''l:1-= OJ',2e-" I
E.
111-er(celf'""OllICC_tU~· · - .t'"':m't./ <i.uly_bat:e.hJlvear l ln~mtl /{dAyJ•1

Answer : A

Next Question

Page: 6/4(,
Total 227 questions
e Prevmus Page Next Page @

CONNECT WITH US

f Facebook

't# Twitter

■ ◄
1:52 PM A
Page: 1 / 14
Total 120 questions mill Want moni questions? Get Premium A ~.
( C11ck To St>e Detai• )

Question 1

In order to prevent accidental commits to production data, a senior data engineer has instituted a policy
that all development work will reference clones of Delta Lake tables. After testing both deep and shallow
clone, development tables are created using shallow clone.

A few weeks after initial table creation, the cloned versions of several tables implemented as Type 1
Slowly Changing Dimension (SCD) stop working The transaction logs for the source tables show that
vacuum was run the day before

Why are the cloned tables no longer working?

A O The data files compacted by vacuum are not tracked by the cloned metadata: running refresh on the cl
oned table will pull in recent changes
B O Because Type 1 changes overwnte existing records, Delta Lake cannot guarantee data consistency for
c loned tables
C O The metadata created by the clone operation is referencing data files that were purged as invalid by th
e vacuum command
D O Running vacuum automatically invalidates any shallow clones of a table; deep clone should always be
used when a cloned table will be repeatedly queried.

In Delta Lake, a shallow clone creates a new table by copying the metadata of the source table without
duplicating the data files. When the vacuum command 1s run on the source table, 11 removes old data
files that are no longer needed to maintain the transactional log's integrity; potentially including files
referenced by the shallow clone's metadata. If these files are purged, the shallow cloned tables will
reference non-existent data files, causing them to stop working properly This highlights the dependency
of shallow clones on the source table's data files and the impact of data management operations like
vacuum on these clones Reference Databricks documentation on Delta Lake, particularly the sections
on cloning tables (shallow and deep cloning) and data retention with the vacuum command
(https://docs.databricks.com/delta/index.html).

Next QuesUOfl

Question 2

A user wants to use DLT expectations to validate that a derived table report contains all records from the
source, Included m the table validation_copy

The user attempts and fails to accomplish this by adding an expectation to the report table definition.

Which approach would allow using DLT expectations to validate all expected records are present in this
table'

A O Define a SQL UDF that performs a left outer join on two tables, and check if this returns null values for
report key values in a DLT expectation for the report table.
B O Define a function that perfonns a left outer Join on validatlon_copy and report and report, and check a
gamst the result in a DLT expectation for the report table
C O Define a temporary table that perform a left outer Join on validation_copy and report, and define an exp
ectation that no report key values are null
D O Define a view that perfonns a left outer join on validatlon_copy and report, and reference this view in D
LT expectations for the report table

To validate that all records from the source are included in the derived table, creating a view that
performs a left outer Join between the validation_copy table and the report 1able Is effecuve. The view
can highlight any discrepancies, such as null values in the repon table's key columns, mdicaling missing
records. This view can then be referenced in DLT (Delta Uve Tables) expectations for the report table to
ensure data Integrity. This approach allows for a comprehensive comparison between the source and
the derived table. Leave a me ssage A

■ ◄
1:s2 PM A ..,11 ~rF, ~. w•

Question 3

The data engineer team has been tasked with configured connections to an external database that does
not have a supported native connector with Databricks The external database already has data security
configured by group membership. These groups map directly to user group already created in Databncks
that represent various teams wnhin the company.

A new login credential has been created for each group m the external database. The Databrlcks Utilities
Secrets module will be used to make these credentials available to Databrlcks users.

Assuming that all the credentials are configured correctly on the external database and group membership
is properly configured on Databricks, which statement describes how teams can be granted the minimum
necessary access to using these credentials?

A O "Read" perrniss1ons should be set on a secret key mapped to 1hose credentials that will be used by a 91
ven team.
B O No additional configuration is necessary as long as all users are configured as administrators in the w
orkspace where secrets have been added.
C O "Read" permissions should be set on a secret scope contam111g only those credentials that will be used
by a given team.
D O "Manage' permission should be set on a secret scope containing only those credentials that will be us
ed by a given team

In Databncks, using the Secrets module allows for secure management of sensitive information such as
database credenlials. Granting 'Read' permissions on a secret key that maps to database credentials for
a spec1f1c team ensures that only members of that team can access these credentials. This approach
aligns with the principle of least privilege, granting users the minimum level of access required to
perform their jobs, thus enhancing secunty.

Databricks Documentation on Secret Management Secrets

Nm Que~hOfl

Question 4

A team of data engineer are adding tables to a DLT pipeline that contain repetitive expectations for many
of the same data quality checks.

One member of the team suggests reusing these data quality rules across all tables defined for this
pipeline.

What approach would allow them to do this?

A O Maintain data quality rules in a Delta table outside of this pipeline's target schema, providing the sche
ma name as a pipeline parameter
B O Use global Python variables to make expectations visible across DLT notebooks included In the same
pipeline
C O Add data quality constraints to tables in this pipeline using an external Job with access to pipeline conf
iguratlon files
D O Maintain data quality rules in a separate Databrlcks notebook that each DlJ notebook of file.

Maintaining data quality rules In a centralized Delta table allows for the reuse of these rules across
muluple DLT (Delta live Tables) pipelines By stonng these rules outside the pipeline's target schema
and referencing the schema name as a pipeline parameter, the team can apply the same set of data
quality checks to different tables wtthin the pipeline. This approach ensures consistency in data quality
validations and reduces redundancy tn code by not having to replicate the same rules m each DLT
notebook or file.

Databricks Documentation on Delta live Tables: Delta Uve Tables Guide

Next Quesuoo

Leave a me ssage A
1:53 PM A ..,11 ~rFi ~ w•
Databricks Documentation on Delta Live Tables: Delta Live Tables Guide

Ne>ttQuesllOf,

Question 5

A Delta Lake table representing metadata about content from user has the following schema:

user_ld LONG, posLtext STRING, post_ld STRING, longitude FLOAT, latitude FLOAT, post_time TIMESTAMP,
date DATE

Based on the above schema, which column is a good candidate for partitioning the Delta Table?

A 0Date
B 0Post_ld

C Ouser_1d
D 0Post_time

Pan1tion1ng a Delta Lake table Improves query performance by organizing data into partitions based on
the values of a column. In the given schema, the date column rs a good candidate for partitioning for
several reasons:

nme-Based Queries: If queries frequently filter or group by date, partitioning by the date column can
significantly Improve performance by limrting the amount of data scanned

Granularity: The date column likely has a granularity that leads to a reasonable number of partitions (not
too many and not too few) This balance Is important for optimizing both read and write perfonmance

Data Skew: Other columns like post_id or user_ld might lead to uneven partition sizes (data skew),
which can negatively impact perfonmance.

Pan1tion1ng by post_t1me could also be considered, but typically date is preferred due to its more
manageable granularity

Delta Lake Documentation on Table Partitioning· Optimizing Layout with Partitioning

Next Quesuoo

Question 6

In order to facilitate near rea~tlme workloads, a data engineer 1s creating a helper function to leverage the
schema detection and evolution functionallty of Oatabricks Auto Loader. The desired function will
automatically detect the schema of the source directly, Incrementally process JSON files as they arrive in a
source directory, and automatically evolve the schema of the table when new fields are detected.

The function is displayed below with a blank:

def auto_load_json(sourc:_path: str,


checkpoin~_pach : s~r ,
tarqet_table_path : str):
(spark.readStream
. formac ( "cloudF'iles")
. opi;ion ( "cloudFiles . iorma i;", "j sen " l
.option( "cloudfiles . schemaLoca-.:ion", checkpoint_path)
. load(source_path)

l
Which response correctly fills In the blank to meet the specified requirements?

. ·,:r i ;;eStrea:r.
A.. ~£:C!.on , ~mergesc±c:rut", r=::.el
.5-drt'.(t~rqec_tcble_:pa~hl
.;,;ri;escream
. cj:tior. <.. cr.ec)q::.in~:.oca~1on", checkpoir..::._pat~)
B. • oi)tionl"reerqesc:r,c:..c", T,.ucl
.-:iqq~r<onc:~=Tn:~
.s~art(ca=~-.:-=lLblcJa~h) Leave a me ssage A
1:53 PM A .1fll ~rFi <:'u 113 1

Delta Lake Documentation on Table Partitioning· Optimizing Layout with Partrtioning

Next Quesuon

Question 6

In order to facilitate near real-time workloads, a data engineer is creating a helper function to leverage the
schema detection and evolution functionality of Databrlcks Auto Loader The desired function will
automatically detect the schema of the source directly, incrementally process JSON files as they arrive m a
source directory, and automatically evolve the schema of the table when new fields are detected

The function is displayed below with a blank:

def auto_load_json(so~rce_path: str,


checlq:oint_pat:h : "tr,
carget_cable_pach : str):
(spark . readStream
, fonna c ( "cloudr1les· J
. opt...ion {11 cloud.File~. forma't .. , "j :son")
.opcion("cloudriles . schemaLocation", checkpolnt_pai:h)
. load(source_path)

Which response correctly fills In the blank to meet the specified requirements?

.wriceScrea:r.
A.• ~pt:.:,n (".c:er9escl:ema", True I
.s~arc(tarqe:_table_;>a:hl
.1o1riceScreare
. .:ption l 11 checky!>in-:.:.cca:1.cr.tt, checkpoir.:_eath)
B. • ~ption I "11,erqeSchcn.4", Tr1.e1
.crlqqer(once=Tr~e
.3tart(ta=~et_ta.cle_patn)

.·.. rite
.QS:ticn1"checkpointLocat1on", checlcpo1nc_pathl
C. . c;: cior. ( "mergeSc!".e:n.a", Tr1,;e,
. o.:tpu-=t-:ode I• 11ppe.'lc!")
.,ave(tarQ~t_table_pathl

-~t-ont"me.rgeScr.ema", T.rue)
D.

. save(targec_table_pathl
. .,ri.:eStrea."!l
•~t.:~onl"checlcpcin:LOca.:ion", checkpoir.t_yathl
E.
. .;;.i;:t:.on l"m-,rgeScl':•::ca", Tru"')
.s::.ar.:(target .:a.t:le eathl
- -
A 00ption A
B Ooption B
C OOption C
D Ooption D

E Ooption E

A IW I

Option B correctly fills in the blank to meet the specified requirements. Option Buses the
"cloudFiles.schemaLocation· option. which is required for the schema detection and evolution
functionality of Databricks Auto Loader. Addltlonally, option B uses the •mergeSchema· option, which is
required for the schema evolution functionality of Databrlcks Auto Loader Finally, option B uses the
"writeStream· method, which is required for the incremental processing of JSON files as they arrive in a
source directory, The other options are incorrect because they either omit the required options, use the
wrong method, or use the wrong format.Reference: Leave a me ssage A
1:53 PM A ..,11 ~rF, ~. w •
•wrrteStream• method, which is required for the incremental processing of JSON files as they arrive 1n a
source directory. The other options are incorrect because they either omit the required options, use the
wrong method, or use the wrong format.Reference:
,r l'h ,t

.......,_id,w,isMMi

'A'Jire c011m r,r, •\a hU , doca doinboc.«£ ,J,n/'lfl~l1t.3! ~ l !l~.aT'I( g wllRng st,n,:n1r'9'<1 a h1ml

Next Quesuoo

Question 7

The data engineering team mamtalns the following code·

import pyspark .:,ql .functions as f

(:,park . tabl1:l " :silver_cust:omer_:,ale:,")


. groupi'lyl"cus~orn<?r_id" )
• agg (
f . min ( "sale_date") . alia:, ( "f ir:,c _ transaction_dar.e") ,
e-. max ( ":sale_dace " ) • all.as ( ":ast_transaction_<!ate") ,
f .mean ("sa.le_toi::al " ) . alias ("ave:::age_sales"),
F .count.Di~tinct; ("order_id .alia3 ("t.ocal_orders '' ) ,
11
)

F . sum ( "sale_to~al" J • alias ( " 11 fetime_value")


) .write
. mode ( " overwrite" J
. table( .. gold_cus:omer_l1fe~ime_sale::s_sumrnary 11
)

l
Assuming that this code produces logically correct results and the data m the source tab(e has been de-
duplicated and validated, which statement descnbes what will occur when this code Is executed?

A O The silver_customer_sales table will be overwritten by aggregated values calculated from all records i
n the gold_customerJifetime_sales_summary table as a batch job.
B O A batch job will update the gold_customerJifetime_sales_summarytable, replacing only those rows th
at have different values than the current version of the table, usmg customer_td as the primary key.
C 0 The gold_customer_llfetime_sales_summary table will be overwrrtten by aggregated values calculated
from all records in the silver_customer_sales table as a batch job.
D O An incremental job will leverage running information In the state store to update aggregate values m th
e gold_customer_lifetime_sales_summary table.
E O An incremental Job will detect if new rows have been written to the s1lver_customer_sales table: i f new
rows are detected, all aggregates will be recalculated and used to overwrite the gold_customer_lifetim
e_sales_summary table.

This code 1s using the pyspark.sql.func11ons library to group the s1lver_customer_sales table by
customer_id and then aggregate the data using the minimum sale date, maximum sale total, and sum
of distinct order ids. The resulting aggregated data 1s then written to the
gold_customer_lifetJme_sales_summary table. overwriting any existing data in that table. This 1s a batch
job that does not use any incremental or streaming logic, and does not perform any merge or update
operations Therefore, the code will overwrite the gold table with the aggregated values from the silver
table every time it is executed.Reference:

https://docs.databricks.com/spark/latest/dataframes-datasets/introduction-to-dataframes-python.html

https://docs.databricks.com/spark/latest/dataframes-datasets/transformlng-data-with-
dataframes.html

https://docs.databricks.com/spark/latest/dataframes-datasets/aggregating-data-with-dataframes.html

Ne>ttQuesllOf,

Page: 1 / 14
Total 120 questions

2025 certshero.com. All rights All Products Guarantee Privacy Policy FAO. OMCA Contact Us
reserved. About Us
Leave a me ssage A

You might also like