Certified Associate Developer for Apache Spark Exam QuestionsBrowse all questions from this exam

Certified Associate Developer for Apache Spark Exam - Question 33


Which of the following operations can be used to return the number of rows in a DataFrame?

Show Answer
Correct Answer: D

The count() method in a DataFrame is used to return the number of rows in the DataFrame. It is the standard way to determine the row count. Other options like numberOfRows(), n(), sum(), and countDistinct() are either non-existent or used for different purposes.

Discussion

1 comment
Sign in to comment
outwalkerOption: D
Nov 8, 2023

The operation that can be used to return the number of rows in a DataFrame is: D. DataFrame.count() The count() method in Spark DataFrame returns the number of rows in the DataFrame, and it is the standard way to determine the row count. Options A, B, C, and E are not valid methods for counting the number of rows in a DataFrame.