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.
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit