Valid Associate-Developer-Apache-Spark Dumps shared by EduDump.com for Helping Passing Associate-Developer-Apache-Spark Exam! EduDump.com now offer the newest Associate-Developer-Apache-Spark exam dumps, the EduDump.com Associate-Developer-Apache-Spark exam questions have been updated and answers have been corrected get the newest EduDump.com Associate-Developer-Apache-Spark dumps with Test Engine here:
Which of the following code blocks displays the 10 rows with the smallest values of column value in DataFrame transactionsDf in a nicely formatted way?
Correct Answer: B
Explanation show() is the correct method to look for here, since the question specifically asks for displaying the rows in a nicely formatted way. Here is the output of show (only a few rows shown): +-------------+---------+-----+-------+---------+----+---------------+ |transactionId|predError|value|storeId|productId| f|transactionDate| +-------------+---------+-----+-------+---------+----+---------------+ | 3| 3| 1| 25| 3|null| 1585824821| | 5| null| 2| null| 2|null| 1575285427| | 4| null| 3| 3| 2|null| 1583244275| +-------------+---------+-----+-------+---------+----+---------------+ With regards to the sorting, specifically in ascending order since the smallest values should be shown first, the following expressions are valid: - transactionsDf.sort(col("value")) ("ascending" is the default sort direction in the sort method) - transactionsDf.sort(asc(col("value"))) - transactionsDf.sort(asc("value")) - transactionsDf.sort(transactionsDf.value.asc()) - transactionsDf.sort(transactionsDf.value) Also, orderBy is just an alias of sort, so all of these expressions work equally well using orderBy. Static notebook | Dynamic notebook: See test 1