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 100 discussion

The code block shown below contains an error. The code block is intended to return the exact number of distinct values in column division in DataFrame storesDF. Identify the error.

Code block:

storesDF.agg(approx_count_distinct(col(“division”)).alias(“divisionDistinct”))

  • A. The approx_count_distinct() operation needs a second argument to set the rsd parameter to ensure it returns the exact number of distinct values.
  • B. There is no alias() operation for the approx_count_distinct() operation's output.
  • C. There is no way to return an exact distinct number in Spark because the data Is distributed across partitions.
  • D. The approx_count_distinct()operation is not a standalone function - it should be used as a method from a Column object.
  • E. The approx_count_distinct() operation cannot determine an exact number of distinct values in a column.
Show Suggested Answer Hide Answer
Suggested Answer: E 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
azure_bimonster
9 months, 3 weeks ago
Selected Answer: E
storesDF.agg(countDistinct("division").alias("divisionDistinct")) can give an exact distinct value unlike E option
upvoted 1 times
...
thanab
1 year, 2 months ago
E The error in the code block is that the approx_count_distinct() operation cannot determine an exact number of distinct values in a column.
upvoted 1 times
...
Ram459
1 year, 3 months ago
Selected Answer: E
can not get exact distinct using apox function
upvoted 3 times
newusername
1 year ago
agree, should be E
upvoted 1 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 ...