Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Associate Developer for Apache Spark All Questions

View all questions & answers for the Certified Associate Developer for Apache Spark exam

Exam Certified Associate Developer for Apache Spark topic 1 question 78 discussion

Which of the following code blocks returns a DataFrame sorted alphabetically based on column division?

  • A. storesDF.sort("division")
  • B. storesDF.orderBy(desc("division"))
  • C. storesDF.orderBy(col("division").desc())
  • D. storesDF.orderBy("division", ascending - true)
  • E. storesDF.sort(desc("division"))
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
58470e1
1 week, 1 day ago
Selected Answer: A
Cannot be D...ascending - true syntax is incorrect. if the optional ascending parameter is supplied, it should be ascending = True...False for descending. By Default, sort method is ascending...so it's A
upvoted 1 times
...
arturffsi
8 months, 2 weeks ago
Option D works as well
upvoted 2 times
gaco
3 months ago
no. Only A. D would work if it was "ascending = True". "ascending = true" is not a valid statement.
upvoted 2 times
...
carlosmps
5 months ago
i think so, both works :s
upvoted 1 times
...
...
azure_bimonster
9 months, 2 weeks ago
Selected Answer: A
A is good one here
upvoted 1 times
...
thanab
1 year, 2 months ago
A https://spark.apache.org/docs/3.1.2/api/python/reference/api/pyspark.sql.DataFrame.orderBy.html#pyspark.sql.DataFrame.orderBy
upvoted 2 times
...
cookiemonster42
1 year, 3 months ago
Selected Answer: A
it's A, checked in databricks
upvoted 1 times
...
zozoshanky
1 year, 3 months ago
C is correct
upvoted 1 times
cookiemonster42
1 year, 3 months ago
we need ascending, not descending, mate
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...