Databricks Certified Associate Developer for Apache Spark

Databricks Certified Associate Developer for Apache Spark

Get started today

Ultimate access to all questions.


You are working with a Spark DataFrame called storesDF read from a nested JSON file. Your task is to display the schema with full metadata and verify if a specific field location.city exists.

Complete the blanks in the following code:

# Display complete schema including metadata
__1__.__2__(__3__)

# Programmatically check if 'location.city' exists in the DataFrame schema
schema_fields = [f.name for f in __4__.__5__.fields]
print("location" in schema_fields)




Comments

Loading comments...