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

The code block shown below should print the schema of DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

__1__.__2__

  • A. 1. storesDF
    2. printSchema(“all”)
  • B. 1. storesDF
    2. schema
  • C. 1. storesDF
    2. getAs[str]
  • D. 1. storesDF
    2. printSchema(true)
  • E. 1. storesDF
    2. printSchema
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
SaiPavan10
7 months ago
B & E results an output. But using df.schema gives you the schema in more detail, df.printSchema just gives the columns that are present in the dataframe. df.printSchema() gives the detailed schema.
upvoted 1 times
...
SaiPavan10
7 months ago
It is df.printSchema().
upvoted 2 times
...
Sowwy1
7 months ago
I think it's B.
upvoted 1 times
...
Gluemr
9 months, 3 weeks ago
E is correct. This question is for scala not python
upvoted 1 times
...
cookiemonster42
1 year, 3 months ago
should be B for printSchema() is should be DataFrame.printSchema() with parenthesis
upvoted 1 times
newusername
11 months, 4 weeks ago
interesting case, either the answer E is indeed not complete () is missing or it is B, though B doesn't print schema but returns schema object
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago