Databricks Certified Associate Developer for Apache Spark 3.0 Exam Databricks-Certified-Associate-Developer-for-Apache-Spark-3.0 Question # 38 Topic 4 Discussion

Databricks Certified Associate Developer for Apache Spark 3.0 Exam Databricks-Certified-Associate-Developer-for-Apache-Spark-3.0 Question # 38 Topic 4 Discussion

Databricks-Certified-Associate-Developer-for-Apache-Spark-3.0 Exam Topic 4 Question 38 Discussion:
Question #: 38
Topic #: 4

The code block displayed below contains an error. The code block should return the average of rows in column value grouped by unique storeId. Find the error.

Code block:

transactionsDf.agg("storeId").avg("value")


A.

Instead of avg("value"), avg(col("value")) should be used.


B.

The avg("value") should be specified as a second argument to agg() instead of being appended to it.


C.

All column names should be wrapped in col() operators.


D.

agg should be replaced by groupBy.


E.

"storeId" and "value" should be swapped.


Get Premium Databricks-Certified-Associate-Developer-for-Apache-Spark-3.0 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.