Chapter 3. Mastering Relational Entities in Databricks
Relational entities, particularly databases, tables, and views, are essential components for organizing and managing structured data in Databricks. Understanding how these entities interact with the metastore and storage locations is crucial for efficient querying and data management. In this chapter, we will cover in detail how these entities function within the Databricks environment and understand their relationship with the underlying storage.
Understanding Relational Entities
This section provides a detailed understanding of relational entities in Databricks, covering databases, tables, and views, with a focus on their interactions with both the metastore and storage systems.
Databases in Databricks
In Databricks, a database essentially corresponds to a schema in a data catalog. This means that when you create a database, you’re essentially defining a logical structure where tables, views, and functions can be organized. This collection of database objects is called a schema. You have the flexibility to create a database using either the CREATE DATABASE or CREATE SCHEMA syntax, as they are functionally equivalent.
Every Databricks workspace includes a local data catalog, called hive_metastore, that all clusters can access to persist object metadata. The Hive metastore serves as a repository for metadata, storing essential information about data structures such as databases, tables, and partitions. This metadata includes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access