Summer Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

Databricks Databricks-Certified-Data-Engineer-Associate - Databricks Certified Data Engineer Associate Exam

Identify how the count_if function and the count where x is null can be used

Consider a table random_values with below data.

What would be the output of below query?

select count_if(col > 1) as count_a. count(*) as count_b.count(col1) as count_c from random_values col1

0

1

2

NULL -

2

3

A.

3 6 5

B.

4 6 5

C.

3 6 6

D.

4 6 6

A data engineer is attempting to drop a Spark SQL table my_table and runs the following command:

DROP TABLE IF EXISTS my_table;

After running this command, the engineer notices that the data files and metadata files have been deleted from the file system.

Which of the following describes why all of these files were deleted?

A.

The table was managed

B.

The table ' s data was smaller than 10 GB

C.

The table ' s data was larger than 10 GB

D.

The table was external

E.

The table did not have a location

A global retail company sells products across multiple categories (e.g.. Electronics, Clothing) and regions (e.g.. North. South, East. West). The sales team has provided the data engineer with a PySpark dataframe named sales_df as below and the team wants the data engineer to analyze the sales data to help them make strategic decisions.

A.

Category_sales = sales df.groupBy( " category " ).agg(sum( " sales amount " ) .alias ( " total sales amount " ))

B.

Category_sales = sales_df.sum( " 3ales_amount " ). g-1- upBy( " categcryn).alias( " toLal_sales_amount))

C.

Category_sale: .es df -agg (sum ( " sales amount " ) .-;r*i:rRy ( " category " ) .alias ( " total sa.en amount " ))

D.

Category_sales = sales_df.groupBy( " reqion " ). agq(sum( " sales_amountn).alias(ntotal_sales_amount ' ' ))

Calculate the total sales amount for each region and store the results in a new dataframe called region_sales.

Given the expected result:

Which code will generate the expected result?

A.

region_sales = sales_df.groupBy( " region " ).agg(sum( " sales_amountM).alias( " total_sales_amount " ))

B.

region_sales = sales_df. sum ( " salen_aiTiount " ) . groupBy ( " region " ) .alias ( " total_sale3_amount " )

C.

region_sales= sales_df.groupBy( " category " ).sum(nsales_amount " ).alias( " t_otal_sales_amounl " )

D.

region sales - sales_df.agg(sum( " sales_amount " ).groupBy( " region " ).alias( " total sales amount " ))

A data engineer needs to create a table in Databricks using data from their organization’s existing SQLite database.

They run the following command:

Which of the following lines of code fills in the above blank to successfully complete the task?

A.

org.apache.spark.sql.jdbc

B.

autoloader

C.

DELTA

D.

sqlite

E.

org.apache.spark.sql.sqlite

A data engineer is cleaning a Bronze table. The requirement is to eliminate rows where either the customer_email field or the customer_phone field is NULL. The cleaning must be performed in one operation using a single method call.

Which PySpark approach supports filtering multiple columns for NULL values in one call?

A.

df.dropna(subset=[ " customer_email " , " customer_phone " ])

B.

df.where( " customer_email IS NOT NULL " ).where( " customer_phone IS NOT NULL " )

C.

df.na.drop(how= " all " )

D.

df.filter(col( " customer_email " ).isNotNull() & col( " customer_phone " ).isNotNull())

A data engineer is working with two tables. Each of these tables is displayed below in its entirety.

The data engineer runs the following query to join these tables together:

Which of the following will be returned by the above query?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

A data engineer needs to apply custom logic to identify employees with more than 5 years of experience in array column employees in table stores. The custom logic should create a new column exp_employees that is an array of all of the employees with more than 5 years of experience for each row. In order to apply this custom logic at scale, the data engineer wants to use the FILTER higher-order function.

Which of the following code blocks successfully completes this task?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

A data engineer has configured a Structured Streaming job to read from a table, manipulate the data, and then perform a streaming write into a new table.

The code block used by the data engineer is below:

Which line of code should the data engineer use to fill in the blank if the data engineer only wants the query to execute a micro-batch to process data every 5 seconds?

A.

trigger( " 5 seconds " )

B.

trigger(continuous= " 5 seconds " )

C.

trigger(once= " 5 seconds " )

D.

trigger(processingTime= " 5 seconds " )