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

The code block shown below should create a single-column DataFrame from Scala list years which is made up of integers. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

__1__.__2__(__3__).__4__

  • A. 1. spark
    2. createDataFrame
    3. years
    4. IntegerType
  • B. 1. spark
    2. createDataset
    3. years
    4. IntegerType
  • C. 1. spark
    2. createDataset
    3. List(years)
    4. toDF
  • D. 1. spark
    2. createDataFrame
    3. List(years)
    4. IntegerType
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
Sowwy1
7 months, 3 weeks ago
I think it's C C. 1. spark 2. createDataset 3. List(years) 4. toDF it says "Scala list"
upvoted 2 times
deadbeef38
5 months ago
I think C is correct, but the result is a DataFrame with a single row whose value is a list of Integers, not a row for each element in the list. None of the other choices makes sense though.
upvoted 1 times
...
Sowwy1
7 months, 2 weeks ago
It's part of official databricks questions: Question 44 Which of the following code blocks creates a single-column DataFrame from Scala Listyears which is made up of integers? A. spark.createDataset(years).toDF B. spark.createDataFrame(years, IntegerType) C. spark.createDataset(years) D. spark.DataFrame(years, IntegerType) E. spark.createDataFrame(years) --> and the answer here is A.
upvoted 2 times
carlosmps
5 months ago
spark.createDataset(years).toDF, to avoid confuse, it's answer C here, and answer A on official databruicks questions. :)
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 ...