Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: validbest

Exam Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 All Questions
Exam Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 All Questions

View all questions & answers for the Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 exam

Databricks Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Question # 12 Topic 2 Discussion

Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Exam Topic 2 Question 12 Discussion:
Question #: 12
Topic #: 2

Given a CSV file with the content:

Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Question 12

And the following code:

from pyspark.sql.types import *

schema = StructType([

StructField("name", StringType()),

StructField("age", IntegerType())

])

spark.read.schema(schema).csv(path).collect()

What is the resulting output?


A.

[Row(name='bambi'), Row(name='alladin', age=20)]


B.

[Row(name='alladin', age=20)]


C.

[Row(name='bambi', age=None), Row(name='alladin', age=20)]


D.

The code throws an error due to a schema mismatch.


Get Premium Databricks-Certified-Associate-Developer-for-Apache-Spark-3.5 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.