DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-0 practice question 2 of 25
Which of the following code blocks shows the structure of a DataFrame in a tree-like way, containing both column names and types?
Full set: 180 questionsitemsDf.printSchema() Correct! Here is an example of what itemsDf.printSchema() shows, you can see the tree-like structure containing both column names and types: root |-- itemId: integer (nullable = true) |-- attributes: array (nullable = true) | |-- element: string (containsNull = true) |-- supplier: string (nullable = true) itemsDf.rdd.printSchema() No, the DataFrame's underlying RDD does not have a printSchema() method. spark.schema(itemsDf) Incorrect, there is no spark.schema command. print(itemsDf.columns) print(itemsDf.dtypes) Wrong. While the output of this code blocks contains both column names and column types, the information is not arranges in a tree-like way. itemsDf.print.schema() No, DataFrame does not have a print method. Static notebook | Dynamic notebook: See test 3,
Keep practicing
Take the free DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-0 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-0 practice questions
- Question 1The code block displayed below contains an error. The code block is intended to perform a…
- Question 3Which of the following code blocks reads the parquet file stored at filePath into DataFra…
- Question 4Which of the following code blocks returns a 2-column DataFrame that shows the distinct v…
- Question 5The code block shown below should return an exact copy of DataFrame transactionsDf that d…
- Question 6The code block displayed below contains an error. The code block should configure Spark t…
- Question 7The code block displayed below contains an error. The code block is intended to return al…
