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

Certified Associate Developer for Apache Spark Exam - Question 78


Which of the following code blocks returns a 10 percent sample of rows from DataFrame storesDF with replacement?

Show Answer
Correct Answer: B

The correct code block that returns a 10 percent sample of rows from DataFrame storesDF with replacement is 'storesDF.sample(true, fraction = 0.1)'. The 'true' parameter indicates sampling with replacement, and 'fraction = 0.1' specifies that 10 percent of the rows should be sampled.

Discussion

1 comment
Sign in to comment
cookiemonster42Option: B
Aug 1, 2023

correct, an easy one