nerdexam
Microsoft

DP-700 · Question #100

You have a table in a Fabric lakehouse that contains the following data: | SalesOrderNumber | OrderDate | CustomerName | Email | |------------------|------------|----------------|---------------------

Sign in or unlock DP-700 to reveal the answer and full explanation for question #100. The question stem and answer options stay visible for context.

Design and implement data ingestion and transformation

Question

You have a table in a Fabric lakehouse that contains the following data:
SalesOrderNumberOrderDateCustomerNameEmail
SO491722021-01-01Brian Howard[email protected]
SO491732021-01-01Linda Alvarez[email protected]
SO491742021-01-01Gina Hernandez[email protected]
SO491782021-01-01Beth Ruiz[email protected]
SO491792021-01-01Evan Ward[email protected]
You have a notebook that contains the following code segment:
01 df = df.withColumn('CustomerName', when(col('CustomerName').isNull() | (col('CustomerName')==''), lit('Unknown')).otherwise(col('CustomerName')))
02 df = df.withColumn('Username', split(col('Email'), '@').getItem(0))
03 df = df.dropDuplicates(['OrderDate']).selectExpr('*', "year(OrderDate') as Year", "('CustomerName') as Username")
04 display(df.head(10))
For each of the following statements, select Yes if the statement is true. Otherwise, select No. NOTE: Each correct selection is worth one point. Statements:
  1. Line 01 will replace all the null and empty values in the CustomerName column with the Unknown value.
  2. Line 02 will extract the value before the @ character and generate a new column named Username.
  3. Line 03 will extract the year value from the OrderDate column and keep only the first occurrence for each year.

Exhibit

DP-700 question #100 exhibit

Unlock DP-700 to see the answer

You've previewed enough free DP-700 questions. Unlock DP-700 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#PySpark#DataFrame Operations#Data Cleaning#Data Transformation
Full DP-700 Practice