Databricks Certified Machine Learning - Associate

Databricks Certified Machine Learning - Associate

Get started today

Ultimate access to all questions.


What is the correct Spark SQL command to create a new catalog named 'ml' in Unity Catalog?




Explanation:

D. By running spark.sql("CREATE CATALOG ml").

To create a new catalog in Unity Catalog using Spark SQL, the CREATE CATALOG command is used followed by the desired catalog name (in this case, 'ml'). This command establishes a new top-level namespace for organizing data assets.

A. By running spark.sql("CREATE SCHEMA ml").

The CREATE SCHEMA command creates a new schema within the currently active catalog, not a new catalog. Schemas are used to organize tables and other data objects under an existing catalog.

B. By running spark.sql("USE CATALOG ml").

The USE CATALOG command switches the current active catalog to the specified one ('ml' here). It does not create a new catalog; the catalog must already exist.

C. By running spark.sql("CREATE CATALOG IF NOT EXISTS ml").

While this command is valid and creates the catalog 'ml' if it doesn't exist, the IF NOT EXISTS clause is optional. The fundamental command for creating a catalog is CREATE CATALOG <catalog_name>.

Powered ByGPT-5